Docker: run as parity user (#9689)

This commit is contained in:
Lorenzo Manacorda 2018-10-03 14:10:05 +02:00 committed by Afri Schoedon
parent 5b87327a43
commit 1388f4d27e

View File

@ -15,8 +15,17 @@ RUN apt autoremove -y
RUN apt clean -y RUN apt clean -y
RUN rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/* 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 #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 # Build a shell script because the ENTRYPOINT command doesn't like using ENV
RUN echo "#!/bin/bash \n ${TARGET} \$@" > ./entrypoint.sh RUN echo "#!/bin/bash \n ${TARGET} \$@" > ./entrypoint.sh