metallb-ip-floater/Dockerfile
Tobias Trabelsi e11b5cd9ff
Some checks are pending
ci/woodpecker/push/woodpecker Pipeline is running
ci/woodpecker/pr/woodpecker Pipeline was successful
ci/woodpecker/pull_request_closed/woodpecker Pipeline was successful
(feat): label node that has floating ip assigned
2024-10-08 22:09:10 +02:00

19 lines
528 B
Docker

FROM golang:1.22 as build
WORKDIR /app
COPY . .
RUN go mod tidy && CGO_ENABLED=0 GOOS=linux go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o metallb-ip-floater ./cmd/
FROM scratch
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=build /etc/passwd /etc/passwd
COPY --from=build /etc/group /etc/group
COPY --from=build --chown=65534:65534 /app/metallb-ip-floater /usr/local/bin/metallb-ip-floater
USER nobody
ENTRYPOINT ["/usr/local/bin/metallb-ip-floater"]