From 1133a51890fd55a407601a7d8af60fd683a1bb29 Mon Sep 17 00:00:00 2001 From: Lorenzo Manacorda Date: Tue, 2 Oct 2018 13:26:07 +0200 Subject: [PATCH] Docker: run as parity user --- scripts/docker/hub/Dockerfile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/docker/hub/Dockerfile b/scripts/docker/hub/Dockerfile index 4eec8cfc61c..53fa092ef9e 100644 --- a/scripts/docker/hub/Dockerfile +++ b/scripts/docker/hub/Dockerfile @@ -15,8 +15,17 @@ RUN apt autoremove -y RUN apt clean -y RUN rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/* +RUN groupadd -g 1000 parity \ + && useradd -m -u 1000 -g parity -s /bin/sh parity + +USER parity + +WORKDIR /home/parity + +ENV PATH "~/bin:${PATH}" + #add TARGET to docker image -COPY artifacts/x86_64-unknown-linux-gnu/$TARGET /usr/bin/$TARGET +COPY artifacts/x86_64-unknown-linux-gnu/$TARGET ./bin/$TARGET # Build a shell script because the ENTRYPOINT command doesn't like using ENV RUN echo "#!/bin/bash \n ${TARGET} \$@" > ./entrypoint.sh