Skip to content

Commit

Permalink
rfac: Move from Debian to Alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
jbouter committed Dec 11, 2023
1 parent b884893 commit cbee430
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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="[email protected]"

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
Expand Down

0 comments on commit cbee430

Please sign in to comment.