drone-ci-demo/Dockerfile
lab 91e76b6d2b
Some checks failed
continuous-integration/drone/push Build is failing
fix: add local files in Dockerfile
2021-12-05 00:56:32 +08:00

22 lines
384 B
Docker

FROM golang:alpine as builder
ENV CGO_ENABLED=0
ENV GOOS="linux"
ENV GOARCH="amd64"
ADD ./ /src
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"
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /src/app .
CMD ["./app"]