Merge pull request #74 from koenrh/update-dockerfile

Update Dockerfile to use official DNSControl binary
This commit is contained in:
Koen Rouwhorst 2022-05-28 19:34:05 +02:00 committed by GitHub
commit b56237e506
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,4 @@
FROM golang:1.18.2-alpine@sha256:e6b729ae22a2f7b6afcc237f7b9da3a27151ecbdcd109f7ab63a42e52e750262 AS install
FROM alpine:3.15@sha256:4edbd2beb5f78b1014028f4fbb99f3237d9561100b6881aabbf5acce2c4f9454
LABEL repository="https://github.com/koenrh/dnscontrol-action"
LABEL maintainer="Koen Rouwhorst <info@koenrouwhorst.nl>"
@ -9,15 +9,16 @@ LABEL "com.github.actions.icon"="cloud"
LABEL "com.github.actions.color"="yellow"
ENV DNSCONTROL_VERSION="3.16.0"
RUN go install -ldflags="-s -w" github.com/StackExchange/dnscontrol/v3@v${DNSCONTROL_VERSION}
FROM alpine:3.15@sha256:4edbd2beb5f78b1014028f4fbb99f3237d9561100b6881aabbf5acce2c4f9454
ENV DNSCONTROL_CHECKSUM="24220c9dcff17c77bff26b5eea2f1886df2abf36581a330d01dde14794b3e7c2"
RUN apk -U --no-cache upgrade && \
apk add --no-cache bash ca-certificates
apk add --no-cache bash ca-certificates curl libc6-compat
COPY --from=install /go/bin/dnscontrol /usr/local/bin/dnscontrol
RUN curl -sL "https://github.com/StackExchange/dnscontrol/releases/download/v$DNSCONTROL_VERSION/dnscontrol-Linux" \
-o dnscontrol && \
echo "$DNSCONTROL_CHECKSUM dnscontrol" | sha256sum -c - && \
chmod +x dnscontrol && \
mv dnscontrol /usr/local/bin/dnscontrol
RUN ["dnscontrol", "version"]