-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from onedr0p/patch-1
fix: update dockerfile to distroless
- Loading branch information
Showing
1 changed file
with
5 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,12 @@ | ||
FROM golang:1.22-alpine as base | ||
|
||
FROM base as builder | ||
# Work directory | ||
FROM golang:1.22-alpine as builder | ||
WORKDIR /build | ||
|
||
# Installing dependencies | ||
COPY go.mod go.sum /build/ | ||
|
||
RUN go mod download | ||
|
||
# Copying all the files | ||
COPY . . | ||
|
||
# Build our application | ||
RUN go build -o /external-dns-unifi-webhook | ||
|
||
FROM alpine:latest | ||
|
||
COPY --from=builder --chown=root:root external-dns-unifi-webhook /bin/ | ||
|
||
EXPOSE 8888 | ||
|
||
# Drop to unprivileged user to run | ||
FROM gcr.io/distroless/static-debian12:nonroot | ||
USER 8675:8675 | ||
CMD ["/bin/external-dns-unifi-webhook"] | ||
COPY --from=builder --chmod=555 /external-dns-unifi-webhook /usr/local/bin/external-dns-unifi-webhook | ||
EXPOSE 8888/tcp | ||
ENTRYPOINT ["/usr/local/bin/external-dns-unifi-webhook"] |