From 1388f4d27e6afbfae48ffca226cacd1d3be32445 Mon Sep 17 00:00:00 2001 From: Lorenzo Manacorda Date: Wed, 3 Oct 2018 14:10:05 +0200 Subject: [PATCH] Docker: run as parity user (#9689) --- 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 4eec8cfc6..53fa092ef 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