ddns/Dockerfile
maximo tejeda 9ba30d10b7
All checks were successful
Generic Build / build (push) Successful in 8s
Build Push Prod / build (push) Successful in 2m27s
ADD tz data to alpine now comes without it
2024-12-10 18:40:43 -04:00

21 lines
565 B
Docker

FROM golang:alpine AS builder
ARG TARGETARCH
ARG version=not-set
ARG SHORTSHA=not-set
WORKDIR /app
COPY . .
# https://stackoverflow.com/questions/70369368/check-architecture-in-dockerfile-to-get-amd-arm
RUN go build -o bin/ddns \
-ldflags "-X main.Shortsha=${SHORTSHA} \
-X main.Version=${version} \
-X main.Aarch=${TARGETARCH}" ./cmd
FROM alpine AS runner
COPY --from=builder /app/bin/ddns /usr/bin/
RUN apk --no-cache add --no-check-certificate ca-certificates \
&& update-ca-certificates
RUN apk add --no-cache tzdata
ENTRYPOINT /usr/bin/ddns