Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rebase acme-dns docker image on google distroless #275

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 17 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
FROM golang:1.13-alpine AS builder
FROM golang:1-alpine AS builder
LABEL maintainer="joona@kuori.org"

RUN apk add --update gcc musl-dev git

ENV GOPATH /tmp/buildcache
RUN git clone https://github.com/joohoi/acme-dns /tmp/acme-dns
RUN git clone --depth=1 https://github.com/joohoi/acme-dns /tmp/acme-dns

ENV GOPATH /tmp/buildcache
ENV CGO_ENABLED 1
WORKDIR /tmp/acme-dns
RUN CGO_ENABLED=1 go build
RUN go build -ldflags="-extldflags=-static"

# assemble the release ready to copy to the image.
RUN mkdir -p /tmp/release/bin
RUN mkdir -p /tmp/release/etc/acme-dns
RUN mkdir -p /tmp/release/var/lib/acme-dns
RUN cp /tmp/acme-dns/acme-dns /tmp/release/bin/acme-dns


FROM alpine:latest
FROM gcr.io/distroless/static

WORKDIR /root/
COPY --from=builder /tmp/acme-dns .
RUN mkdir -p /etc/acme-dns
RUN mkdir -p /var/lib/acme-dns
RUN rm -rf ./config.cfg
RUN apk --no-cache add ca-certificates && update-ca-certificates
WORKDIR /
COPY --from=builder /tmp/release .

VOLUME ["/etc/acme-dns", "/var/lib/acme-dns"]
ENTRYPOINT ["./acme-dns"]
ENTRYPOINT ["/bin/acme-dns"]
EXPOSE 53 80 443
EXPOSE 53/udp