ddns/Dockerfile
maximo tejeda d6d1450a46
All checks were successful
Go-tags / build (push) Successful in 2m12s
fix args and pass var
2024-11-15 11:43:05 -04:00

17 lines
476 B
Docker

FROM golang:alpine AS builder
ARG BUILDPLATFORM=${BUILDPLATFORM:-linux/amd64}
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=${BUILDPLATFORM}" ./cmd
FROM alpine AS runner
COPY --from=builder /app/bin/ddns /usr/bin/
ENTRYPOINT /usr/bin/ddns