diff --git a/Dockerfile b/Dockerfile index 001b8b3..e52b526 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,23 @@ -FROM debian:latest as builder +FROM alpine:latest as builder ARG VERSION=0.2.0 -RUN apt update && \ - apt install -y curl && \ - curl -sLo /tmp/messagebird_exporter.deb \ - https://github.com/roaldnefs/messagebird_exporter/releases/download/v${VERSION}/messagebird_exporter_${VERSION}_linux_amd64.deb && \ - apt install -y /tmp/messagebird_exporter.deb +WORKDIR /tmp +RUN apk update && \ + apk add curl && \ + curl -sLo ./messagebird_exporter.tar.gz \ + https://github.com/roaldnefs/messagebird_exporter/releases/download/v${VERSION}/messagebird_exporter_${VERSION}_linux_amd64.tar.gz && \ + tar -xf messagebird_exporter.tar.gz -FROM debian:latest as production +FROM alpine:latest as production LABEL maintainer="info@warpnet.nl" -RUN adduser --system -uid 800 --no-create-home messagebird_exporter +#RUN adduser --system -uid 800 --no-create-home messagebird_exporter +RUN addgroup -S -g 800 messagebird_exporter \ + && adduser -S -u 800 -S -H -D -G messagebird_exporter messagebird_exporter -COPY --from=builder /usr/bin/messagebird_exporter /usr/bin/messagebird_exporter +COPY --from=builder /tmp/messagebird_exporter /usr/bin/messagebird_exporter WORKDIR /tmp USER messagebird_exporter