mirror of
https://github.com/prometheus-community/postgres_exporter
synced 2025-04-09 02:31:33 +00:00
Docker file added multistage build to add non-root user running under ID:20001 for image.
Reduces attack surface by not running image as root user
This commit is contained in:
parent
85c31524f6
commit
06781103f0
@ -1,5 +1,11 @@
|
|||||||
|
FROM debian:7.11-slim
|
||||||
|
RUN useradd -u 20001 postgres_exporter
|
||||||
|
|
||||||
FROM scratch
|
FROM scratch
|
||||||
|
|
||||||
|
COPY --from=0 /etc/passwd /etc/passwd
|
||||||
|
USER postgres_exporter
|
||||||
|
|
||||||
ARG binary
|
ARG binary
|
||||||
|
|
||||||
COPY $binary /postgres_exporter
|
COPY $binary /postgres_exporter
|
||||||
|
Loading…
Reference in New Issue
Block a user