drone-ci-demo/Dockerfile

21 lines
383 B
Docker
Raw Permalink Normal View History

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