2022-08-05 00:57:25 +08:00
|
|
|
FROM golang:1.19.0-alpine3.16@sha256:f8e128fa8aa891fe29e22e6401686dffef9bd4c3f5b552b09a7c29f7379979c1 AS build
|
2022-06-03 22:39:57 +08:00
|
|
|
|
2022-06-16 04:17:44 +08:00
|
|
|
WORKDIR /go/src/github.com/StackExchange/dnscontrol
|
|
|
|
|
|
|
|
ARG BUILD_VERSION
|
|
|
|
|
|
|
|
ENV GO111MODULE on
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
# build dnscontrol
|
|
|
|
RUN apk update \
|
|
|
|
&& apk add --no-cache ca-certificates curl gcc build-base git \
|
|
|
|
&& update-ca-certificates \
|
|
|
|
&& go build -v -trimpath -buildmode=pie -ldflags="-s -w -X main.SHA=${BUILD_VERSION}"
|
|
|
|
|
|
|
|
# Validation check
|
|
|
|
RUN cp dnscontrol /go/bin/dnscontrol
|
|
|
|
RUN dnscontrol version
|
|
|
|
|
|
|
|
# -----
|
|
|
|
|
2022-07-20 22:46:45 +08:00
|
|
|
FROM alpine:3.16.1@sha256:7580ece7963bfa863801466c0a488f11c86f85d9988051a9f9c68cb27f6b7872
|
2022-06-16 04:17:44 +08:00
|
|
|
|
|
|
|
COPY --from=build /etc/ssl/certs /etc/ssl/certs
|
|
|
|
COPY --from=build /go/bin/dnscontrol /usr/local/bin
|
|
|
|
|
|
|
|
WORKDIR /dns
|
|
|
|
|
|
|
|
ENTRYPOINT ["/usr/local/bin/dnscontrol"]
|