dnsupdater/Dockerfile

19 lines
634 B
Docker

FROM golang:1.15.3-alpine3.12 as builder
RUN apk add --update --no-cache ca-certificates git tzdata
WORKDIR /tmp/dnsupdater
COPY go.mod go.sum ./
RUN go mod download
COPY ./ ./
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o dnsupdater ./cmd/dnsupdater
FROM busybox:glibc
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
RUN mkdir -p /var/spool/cron/crontabs /var/log
RUN touch /var/log/cron.log
COPY entry.sh /entry.sh
RUN chmod +x entry.sh
COPY --from=builder /tmp/dnsupdater/dnsupdater .
ENTRYPOINT ["/entry.sh"]