Skip to content

Commit

Permalink
Merge pull request #571 from grafana/jvp/distroless-image
Browse files Browse the repository at this point in the history
docker: build using distroless image
  • Loading branch information
jesusvazquez authored Dec 4, 2024
2 parents b2f9603 + 17618ac commit e216f17
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
FROM alpine
FROM alpine as builder
RUN apk --update add --no-cache ca-certificates
ADD carbon-relay-ng-linux-amd64 /bin/carbon-relay-ng
RUN mkdir /var/spool/carbon-relay-ng

# But the final image is distroless
FROM gcr.io/distroless/static-debian12
COPY --from=builder /etc/ssl /etc/ssl
COPY --from=builder /var/spool /var/spool

VOLUME /conf
ADD examples/carbon-relay-ng.ini /conf/carbon-relay-ng.ini
RUN mkdir /var/spool/carbon-relay-ng
ADD carbon-relay-ng-linux-amd64 /bin/carbon-relay-ng

ENTRYPOINT ["/bin/carbon-relay-ng"]
CMD ["/conf/carbon-relay-ng.ini"]

0 comments on commit e216f17

Please sign in to comment.