ddns/Dockerfile
maximo tejeda 29f906c94e
Some checks failed
Go-tags / build (push) Failing after 2s
ADD docker specs
2024-11-15 09:51:24 -04:00

17 lines
455 B
Docker

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