Skip to content

Commit

Permalink
Merge pull request #7 from onedr0p/patch-1
Browse files Browse the repository at this point in the history
fix: update dockerfile to distroless
  • Loading branch information
kashalls authored May 23, 2024
2 parents 6525b35 + 42cba94 commit 1db4994
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions Dockerfile
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"]

0 comments on commit 1db4994

Please sign in to comment.