Docker: use tini as init system (#72)
This commit is contained in:
parent
2bc7ea9e06
commit
d18c045c98
2 changed files with 4 additions and 2 deletions
|
@ -119,12 +119,14 @@ RUN description="$(file /tmp/binary)" && \
|
||||||
FROM alpine:${ALPINE_VERSION}
|
FROM alpine:${ALPINE_VERSION}
|
||||||
EXPOSE 9586/tcp
|
EXPOSE 9586/tcp
|
||||||
WORKDIR /usr/local/bin
|
WORKDIR /usr/local/bin
|
||||||
|
RUN apk add --no-cache --q tini && \
|
||||||
|
rm -rf /var/cache/apk/*
|
||||||
RUN adduser prometheus-wireguard-exporter -s /bin/sh -D -u 1000 1000 && \
|
RUN adduser prometheus-wireguard-exporter -s /bin/sh -D -u 1000 1000 && \
|
||||||
mkdir -p /etc/sudoers.d && \
|
mkdir -p /etc/sudoers.d && \
|
||||||
echo 'prometheus-wireguard-exporter ALL=(root) NOPASSWD:/usr/bin/wg show * dump' > /etc/sudoers.d/prometheus-wireguard-exporter && \
|
echo 'prometheus-wireguard-exporter ALL=(root) NOPASSWD:/usr/bin/wg show * dump' > /etc/sudoers.d/prometheus-wireguard-exporter && \
|
||||||
chmod 0440 /etc/sudoers.d/prometheus-wireguard-exporter
|
chmod 0440 /etc/sudoers.d/prometheus-wireguard-exporter
|
||||||
RUN apk add --update -q --no-cache wireguard-tools-wg sudo
|
RUN apk add --update -q --no-cache wireguard-tools-wg sudo
|
||||||
USER prometheus-wireguard-exporter
|
USER prometheus-wireguard-exporter
|
||||||
ENTRYPOINT [ "/usr/local/bin/prometheus_wireguard_exporter" ]
|
ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/prometheus_wireguard_exporter"]
|
||||||
CMD [ "-a" ]
|
CMD [ "-a" ]
|
||||||
COPY --from=build --chown=prometheus-wireguard-exporter /tmp/binary ./prometheus_wireguard_exporter
|
COPY --from=build --chown=prometheus-wireguard-exporter /tmp/binary ./prometheus_wireguard_exporter
|
||||||
|
|
|
@ -45,7 +45,7 @@ Coming soon, subcribe to [#59](https://github.com/MindFlavor/prometheus_wireguar
|
||||||
1. Download and run the container with:
|
1. Download and run the container with:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
docker run -d --init --net=host --cap-add=NET_ADMIN --name wgexporter mindflavor/prometheus-wireguard-exporter
|
docker run -d --net=host --cap-add=NET_ADMIN --name wgexporter mindflavor/prometheus-wireguard-exporter
|
||||||
```
|
```
|
||||||
|
|
||||||
1. Check it's up by visiting [http://localhost:9586/metrics](http://localhost:9586/metrics)
|
1. Check it's up by visiting [http://localhost:9586/metrics](http://localhost:9586/metrics)
|
||||||
|
|
Loading…
Reference in a new issue