Add dockerfile (#7)

web-ui
techknowlogick 6 vuotta sitten committed by Gitea
vanhempi 92b6438b55
commit f05c383db2
  1. 10
      .drone.yml
  2. 18
      Dockerfile
  3. 4
      Makefile

@ -44,4 +44,12 @@ pipeline:
- sha256
- md5
when:
event: [ tag ]
event: [ tag ]
docker:
image: plugins/docker:17.12
secrets: [ docker_username, docker_password ]
pull: true
repo: jonasfranz/gitea-github-migrator
default_tags: true
when:
event: [ push, tag ]

@ -0,0 +1,18 @@
#Build stage
FROM golang:1.10-alpine3.7 AS build-env
#Build deps
RUN apk --no-cache add build-base git
#Setup repo
COPY . ${GOPATH}/src/git.jonasfranz.software/JonasFranzDEV/gitea-github-migrator
WORKDIR ${GOPATH}/src/git.jonasfranz.software/JonasFranzDEV/gitea-github-migrator
RUN make docker-binary
FROM alpine:3.7
LABEL maintainer="info@jonasfranz.software"
COPY --from=build-env /go/src/git.jonasfranz.software/JonasFranzDEV/gitea-github-migrator/gitea-github-migrator /usr/local/bin/gitea-github-migrator
ENTRYPOINT ["/usr/local/bin/gitea-github-migrator"]

@ -18,6 +18,10 @@ LDFLAGS := -X main.Version=$(VERSION) -X main.build=$(BUILD)
.PHONY: all
all:
.PHONY: docker-binary
docker-binary:
go build -ldflags "$(LDFLAGS)" -o gitea-github-migrator
.PHONY: release
release:
@hash gox > /dev/null 2>&1; if [ $$? -ne 0 ]; then \

Ladataan…
Peruuta
Tallenna