Skip to content

Commit

Permalink
Improve Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
ribbybibby committed Oct 18, 2020
1 parent 3df8d10 commit 57dba2c
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
FROM quay.io/prometheus/busybox:latest
FROM golang:1.15-buster AS build

COPY s3_exporter /bin/s3_exporter
ADD . /tmp/s3_exporter

ENTRYPOINT ["/bin/s3_exporter"]
RUN cd /tmp/s3_exporter && \
echo "s3:*:100:s3" > group && \
echo "s3:*:100:100::/:/s3_exporter" > passwd && \
make


FROM scratch

COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=build /tmp/s3_exporter/group \
/tmp/s3_exporter/passwd \
/etc/
COPY --from=build /tmp/s3_exporter/s3_exporter /

USER s3:s3
EXPOSE 9340/tcp
ENTRYPOINT ["/s3_exporter"]

0 comments on commit 57dba2c

Please sign in to comment.