From 8859356be9e565d5a24a61b191c9e1bf617c99dc Mon Sep 17 00:00:00 2001 From: Joao Zanutto Date: Mon, 1 Apr 2024 07:37:49 -0700 Subject: [PATCH 1/4] change docker container user to greenmask --- docker/greenmask/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docker/greenmask/Dockerfile b/docker/greenmask/Dockerfile index daf2ca71..8db8c032 100644 --- a/docker/greenmask/Dockerfile +++ b/docker/greenmask/Dockerfile @@ -38,4 +38,7 @@ RUN mkdir ~/.bash_completions \ && echo 'source /etc/bash_completion' >> /root/.bashrc \ && echo 'source /root/.bash_completions/greenmask.bash' >> /root/.bashrc +RUN groupadd -r greenmask && useradd -r -g greenmask greenmask +USER greenmask + ENTRYPOINT ["/bin/bash"] From 5647f2bf78e9fcc41c3faaa078bcbd696f160ca2 Mon Sep 17 00:00:00 2001 From: Joao Zanutto Date: Mon, 1 Apr 2024 07:38:30 -0700 Subject: [PATCH 2/4] adjust docker image entrypoint --- docker/greenmask/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/greenmask/Dockerfile b/docker/greenmask/Dockerfile index 8db8c032..36c656dd 100644 --- a/docker/greenmask/Dockerfile +++ b/docker/greenmask/Dockerfile @@ -41,4 +41,4 @@ RUN mkdir ~/.bash_completions \ RUN groupadd -r greenmask && useradd -r -g greenmask greenmask USER greenmask -ENTRYPOINT ["/bin/bash"] +ENTRYPOINT ["greenmask"] From 104116cd13bd7c5ce3907bab9d35b6ab1f9295b4 Mon Sep 17 00:00:00 2001 From: Joao Zanutto Date: Mon, 1 Apr 2024 10:45:29 -0700 Subject: [PATCH 3/4] adjust dockerfile --- docker/greenmask/Dockerfile | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/docker/greenmask/Dockerfile b/docker/greenmask/Dockerfile index 36c656dd..d0c4e9d9 100644 --- a/docker/greenmask/Dockerfile +++ b/docker/greenmask/Dockerfile @@ -33,12 +33,16 @@ RUN apt-get update \ COPY --from=build /var/lib/greenmask/greenmask /usr/bin -RUN mkdir ~/.bash_completions \ - && greenmask completion bash > /root/.bash_completions/greenmask.bash \ - && echo 'source /etc/bash_completion' >> /root/.bashrc \ - && echo 'source /root/.bash_completions/greenmask.bash' >> /root/.bashrc +RUN mkdir /home/greenmask \ + && groupadd -g 10001 greenmask \ + && useradd -u 10000 -g greenmask greenmask \ + && chown -R greenmask:greenmask /home/greenmask + +USER greenmask:greenmask -RUN groupadd -r greenmask && useradd -r -g greenmask greenmask -USER greenmask +RUN mkdir ~/.bash_completions \ + && greenmask completion bash > ~/.bash_completions/greenmask.bash \ + && echo 'source /etc/bash_completion' >> ~/.bashrc \ + && echo 'source ~/.bash_completions/greenmask.bash' >> ~/.bashrc ENTRYPOINT ["greenmask"] From ee587fd7b107fc9cca79fb43b06f3b3d75dadfab Mon Sep 17 00:00:00 2001 From: Joao Zanutto Date: Mon, 1 Apr 2024 10:46:21 -0700 Subject: [PATCH 4/4] adjust playground run script --- playground/run.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/playground/run.sh b/playground/run.sh index a2f9ba91..596c9bdd 100755 --- a/playground/run.sh +++ b/playground/run.sh @@ -1,6 +1,6 @@ #!/bin/bash -echo "alias psql='psql -U postgres -d $ORIGINAL_DB_NAME -h playground-db'" >> /root/.bashrc -echo "alias psql_o='psql -U postgres -d $ORIGINAL_DB_NAME -h playground-db'" >> /root/.bashrc -echo "alias psql_t='psql -U postgres -d $TRANSFORMED_DB_NAME -h playground-db'" >> /root/.bashrc -echo "alias cleanup='/var/lib/playground/cleanup.sh'" >> /root/.bashrc +echo "alias psql='psql -U postgres -d $ORIGINAL_DB_NAME -h playground-db'" >> ~/.bashrc +echo "alias psql_o='psql -U postgres -d $ORIGINAL_DB_NAME -h playground-db'" >> ~/.bashrc +echo "alias psql_t='psql -U postgres -d $TRANSFORMED_DB_NAME -h playground-db'" >> ~/.bashrc +echo "alias cleanup='/var/lib/playground/cleanup.sh'" >> ~/.bashrc bash