Browse Source

Add dockerfile (#7)

tags/v0.0.10
techknowlogick Gitea 1 year ago
parent
commit
f05c383db2
3 changed files with 31 additions and 1 deletions
  1. +9
    -1
      .drone.yml
  2. +18
    -0
      Dockerfile
  3. +4
    -0
      Makefile

+ 9
- 1
.drone.yml View File

@@ -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 ]

+ 18
- 0
Dockerfile View File

@@ -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"]

+ 4
- 0
Makefile View File

@@ -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 \


Loading…
Cancel
Save