Handle go modules properly in Dockerfile with Go 1.13 (#207)

This commit is contained in:
Joona Hoikkala 2020-01-10 12:32:11 +02:00 committed by GitHub
parent 3d5a512d1e
commit 5de21916a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,14 +3,15 @@ LABEL maintainer="joona@kuori.org"
RUN apk add --update gcc musl-dev git RUN apk add --update gcc musl-dev git
RUN go get github.com/joohoi/acme-dns ENV GOPATH /tmp/buildcache
WORKDIR /go/src/github.com/joohoi/acme-dns RUN git clone https://github.com/joohoi/acme-dns /tmp/acme-dns
WORKDIR /tmp/acme-dns
RUN CGO_ENABLED=1 go build RUN CGO_ENABLED=1 go build
FROM alpine:latest FROM alpine:latest
WORKDIR /root/ WORKDIR /root/
COPY --from=builder /go/src/github.com/joohoi/acme-dns . COPY --from=builder /tmp/acme-dns .
RUN mkdir -p /etc/acme-dns RUN mkdir -p /etc/acme-dns
RUN mkdir -p /var/lib/acme-dns RUN mkdir -p /var/lib/acme-dns
RUN rm -rf ./config.cfg RUN rm -rf ./config.cfg