From 5de21916a32769bdc36af0485ac128832b2cbd90 Mon Sep 17 00:00:00 2001 From: Joona Hoikkala Date: Fri, 10 Jan 2020 12:32:11 +0200 Subject: [PATCH] Handle go modules properly in Dockerfile with Go 1.13 (#207) --- Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1613dd2..47ee5fd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,14 +3,15 @@ LABEL maintainer="joona@kuori.org" RUN apk add --update gcc musl-dev git -RUN go get github.com/joohoi/acme-dns -WORKDIR /go/src/github.com/joohoi/acme-dns +ENV GOPATH /tmp/buildcache +RUN git clone https://github.com/joohoi/acme-dns /tmp/acme-dns +WORKDIR /tmp/acme-dns RUN CGO_ENABLED=1 go build FROM alpine:latest 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 /var/lib/acme-dns RUN rm -rf ./config.cfg