Skip to content

Commit

Permalink
Move production Docker image to Alpine (#280)
Browse files Browse the repository at this point in the history
  • Loading branch information
awbn authored Oct 30, 2024
1 parent 32e6922 commit 5018441
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ COPY . .
RUN go get -d -v ./...
RUN CGO_ENABLED=0 go build -a -installsuffix cgo -o gickup .

# Use scratch as production environment -> Small builds
FROM scratch as production
# Use alpine as production environment -> Small builds
FROM alpine:3.20 as production
RUN apk add -U --no-cache ca-certificates tzdata git git-lfs
RUN git lfs install

WORKDIR /
# Copy valid SSL certs from the builder for fetching github/gitlab/...
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
# Copy zoneinfo for getting the right cron timezone
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
# Copy the main executable from the builder
COPY --from=builder /go/src/github.com/cooperspencer/gickup/gickup /gickup/gickup

ENTRYPOINT [ "/gickup/gickup" ]
CMD [ "/gickup/conf.yml" ]
CMD [ "/gickup/conf.yml" ]

0 comments on commit 5018441

Please sign in to comment.