From b2f7c8d842fd765508f8c7f5055242e8e9fdfad3 Mon Sep 17 00:00:00 2001 From: Goutham Veeramachaneni Date: Mon, 19 Jun 2017 15:03:39 +0530 Subject: [PATCH] Use user nobody in Dockerfile Signed-off-by: Goutham Veeramachaneni --- Dockerfile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4ffd65d76..fd533440a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,17 +7,15 @@ COPY documentation/examples/prometheus.yml /etc/prometheus/prometheus.yml COPY console_libraries/ /usr/share/prometheus/console_libraries/ COPY consoles/ /usr/share/prometheus/consoles/ -RUN ln -s /usr/share/prometheus/console_libraries /usr/share/prometheus/consoles/ /etc/prometheus/ && \ - addgroup -g 1000 prometheus && \ - adduser -s /bin/sh -S -H -u 1000 -G prometheus prometheus && \ - mkdir -p /prometheus && \ - chown -R prometheus:prometheus /etc/prometheus /prometheus +RUN ln -s /usr/share/prometheus/console_libraries /usr/share/prometheus/consoles/ /etc/prometheus/ +RUN mkdir -p /prometheus && \ + chown -R nobody:nogroup etc/prometheus /prometheus +USER nobody EXPOSE 9090 VOLUME [ "/prometheus" ] WORKDIR /prometheus ENTRYPOINT [ "/bin/prometheus" ] -USER prometheus CMD [ "-config.file=/etc/prometheus/prometheus.yml", \ "-storage.local.path=/prometheus", \ "-web.console.libraries=/usr/share/prometheus/console_libraries", \