dnscontrol/Dockerfile
dependabot[bot] f877549ca5
Bump golang from 1.18.3-alpine3.16 to 1.18.4-alpine3.16 (#1618)
Bumps golang from 1.18.3-alpine3.16 to 1.18.4-alpine3.16.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-13 12:55:29 -04:00

31 lines
778 B
Docker

FROM golang:1.18.4-alpine3.16@sha256:46f1fa18ca1ec228f7ea4978ad717f0a8c5e51436e7b8efaf64011f7729886df AS build
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
# -----
FROM alpine:3.16.0@sha256:686d8c9dfa6f3ccfc8230bc3178d23f84eeaf7e457f36f271ab1acc53015037c
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"]