From fb0b72b3424bdf256283afcabb2723e2124ab975 Mon Sep 17 00:00:00 2001 From: Nikolay Edigaryev Date: Wed, 7 Oct 2020 17:21:32 +0300 Subject: [PATCH 1/2] Produce statically linked binary to avoid dynamic library issues --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4a50606..8956761 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,11 +5,11 @@ ADD . /build RUN go get -t -v ./... && \ go test -v ./... && \ - go build -o google-storage-proxy ./cmd/ + CGO_ENABLED=0 go build -o google-storage-proxy ./cmd/ FROM alpine:latest LABEL org.opencontainers.image.source=https://github.com/cirruslabs/google-storage-proxy/ WORKDIR /svc COPY --from=builder /build/google-storage-proxy /svc/ -ENTRYPOINT ["/svc/google-storage-proxy"] \ No newline at end of file +ENTRYPOINT ["/svc/google-storage-proxy"] From 247a26607b5d466a8fd583218b1d2789ea174a95 Mon Sep 17 00:00:00 2001 From: Nikolay Edigaryev Date: Wed, 7 Oct 2020 17:22:42 +0300 Subject: [PATCH 2/2] No need to "go get" and "go test" --- Dockerfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8956761..93bdcdc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,9 +3,7 @@ FROM golang:latest as builder WORKDIR /build ADD . /build -RUN go get -t -v ./... && \ - go test -v ./... && \ - CGO_ENABLED=0 go build -o google-storage-proxy ./cmd/ +RUN CGO_ENABLED=0 go build -o google-storage-proxy ./cmd/ FROM alpine:latest LABEL org.opencontainers.image.source=https://github.com/cirruslabs/google-storage-proxy/