From c0dff41b3c7863a19ff24350d6a25b717ce3afc8 Mon Sep 17 00:00:00 2001 From: Blair Vanderlugt Date: Mon, 15 Mar 2021 07:10:08 -0700 Subject: [PATCH] fix home dir permissions --- apps/contract-migration/docker/Dockerfile | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/apps/contract-migration/docker/Dockerfile b/apps/contract-migration/docker/Dockerfile index f78dfac..6d5735e 100644 --- a/apps/contract-migration/docker/Dockerfile +++ b/apps/contract-migration/docker/Dockerfile @@ -104,26 +104,17 @@ FROM python:3.8.6-slim-buster as runtime-image COPY --from=compile-image /usr/local/bin/ /usr/local/bin/ COPY --from=compile-image /usr/local/etc/cic/ /usr/local/etc/cic/ -RUN mkdir -p /tmp/cic/config -RUN chmod a+rw /tmp/cic/config ENV HOME /home/grassroots RUN useradd --create-home grassroots WORKDIR $HOME # COPY python dependencies to user dir COPY --from=compile-image /root/.local .local -RUN chown -R grassroots:grassroots $HOME/.local/ ENV PATH=$HOME/.local/bin:$PATH - -USER grassroots +# RUN chown grassroots:grassroots $HOME/.local/ COPY contract-migration/testdata/pgp testdata/pgp COPY contract-migration/wait-for-it.sh . -# RUN chmod +x ./wait-for-it.sh - -# COPY contract-migration/.env_config_template .env_config_template -# COPY contract-migration/.env_dockercompose_template .env_dockercompose_template - COPY contract-migration/reset.sh reset.sh COPY contract-migration/from_env.sh from_env.sh COPY contract-migration/seed_cic_eth.sh seed_cic_eth.sh @@ -131,4 +122,14 @@ COPY contract-migration/sarafu_declaration.json sarafu_declaration.json COPY contract-migration/keystore keystore COPY contract-migration/envlist . +# critically, includes the .local folder from compile-image +RUN chown -R grassroots:grassroots . + +RUN mkdir -p /tmp/cic/config +RUN chown grassroots:grassroots /tmp/cic/config +# A shared output dir for environment configs +RUN chmod a+rwx /tmp/cic/config + +USER grassroots + ENTRYPOINT [ ]