From 929e2915429cd3ba528a0c00369f6a5844691f6d Mon Sep 17 00:00:00 2001 From: Sergey Bogatyrets Date: Wed, 7 Jul 2021 14:17:44 +0300 Subject: [PATCH] Add TZ package for build stage, support TZ env variable in scratch container --- Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1f04b1d..f16569d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,13 @@ ARG GOLANG_VERSION="1.12" FROM golang:$GOLANG_VERSION-alpine as builder -WORKDIR /go/src/github.com/olebedev/socks5 +RUN apk --no-cache add tzdata +WORKDIR /go/src/github.com/serjs/socks5 COPY . . RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-s' -o ./socks5 FROM scratch +COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ -COPY --from=builder /go/src/github.com/olebedev/socks5/socks5 / +COPY --from=builder /go/src/github.com/serjs/socks5/socks5 / ENTRYPOINT ["/socks5"]