drone-ci-demo/Dockerfile
lab b877f2b9e8
All checks were successful
continuous-integration/drone/push Build is passing
feat: multi-stage builds
2021-12-05 01:21:24 +08:00

21 lines
383 B
Docker

FROM alpine:3.14 as builder
ENV CGO_ENABLED=0
ENV GOOS="linux"
ENV GOARCH="amd64"
WORKDIR /src
RUN apk --no-cache add ca-certificates
#RUN go build -ldflags="-s -w" -tags timetzdata -o app main.go
FROM scratch as production
ENV TZ="Asia/Shanghai"
ADD ./app .
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
#COPY --from=builder /src/app .
CMD ["./app"]