ddns/Dockerfile
maximo tejeda fba129ec43
All checks were successful
Build Push / build (push) Successful in 2m8s
squash from 47e81fd011
2024-11-16 11:14:03 -04:00

17 lines
440 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/
ENTRYPOINT /usr/bin/ddns