Skip to content

Commit

Permalink
using distroless
Browse files Browse the repository at this point in the history
Signed-off-by: Arnav Gupta <dev@championswimmer.in>
  • Loading branch information
championswimmer committed Aug 8, 2024
1 parent ecaed81 commit 4af1d1f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ FROM golang:1.22 AS builder
# Install CA certificates
RUN apt-get update && apt-get install -y ca-certificates


# Move to working directory (/build).
RUN mkdir /build
WORKDIR /build

# Copy and download dependency using go mod.
Expand All @@ -18,7 +20,7 @@ ENV CGO_ENABLED=1 GOOS=linux GOARCH=amd64
# RUN go build -ldflags="-s -w" -o onepixel ./src/main.go
RUN make build DOCS=false

FROM scratch
FROM gcr.io/distroless/static-debian12

LABEL maintainer="Arnav Gupta <championswimmer@gmail.com> (https://arnav.tech)"
LABEL description="OnePixel is a simple, self-hosted, one pixel web analytics tool"
Expand All @@ -31,4 +33,4 @@ COPY --from=builder ["/build/bin/onepixel", "/"]
COPY --from=builder ["/build/public_html", "/public_html"]

# Command to run when starting the container.
ENTRYPOINT ["/onepixel"]
CMD ["/onepixel"]

0 comments on commit 4af1d1f

Please sign in to comment.