1
0
mirror of https://github.com/prometheus-community/postgres_exporter.git synced 2025-11-25 10:43:13 +03: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:
Janis Orlovs
2019-02-16 00:36:08 +02:00
committed by Will Rouesnel
parent 85c31524f6
commit 06781103f0

View File

@@ -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