diff --git a/docker/greenmask/Dockerfile b/docker/greenmask/Dockerfile index daf2ca71..d0c4e9d9 100644 --- a/docker/greenmask/Dockerfile +++ b/docker/greenmask/Dockerfile @@ -33,9 +33,16 @@ RUN apt-get update \ COPY --from=build /var/lib/greenmask/greenmask /usr/bin +RUN mkdir /home/greenmask \ + && groupadd -g 10001 greenmask \ + && useradd -u 10000 -g greenmask greenmask \ + && chown -R greenmask:greenmask /home/greenmask + +USER greenmask:greenmask + 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 + && greenmask completion bash > ~/.bash_completions/greenmask.bash \ + && echo 'source /etc/bash_completion' >> ~/.bashrc \ + && echo 'source ~/.bash_completions/greenmask.bash' >> ~/.bashrc -ENTRYPOINT ["/bin/bash"] +ENTRYPOINT ["greenmask"] 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