Skip to content

Commit

Permalink
Adjust permission during build time instead of run-time
Browse files Browse the repository at this point in the history
  • Loading branch information
cytopia committed Jul 3, 2022
1 parent 4b9739a commit e0cb0c1
Show file tree
Hide file tree
Showing 15 changed files with 56 additions and 6 deletions.
6 changes: 0 additions & 6 deletions Dockerfiles/base/data/docker-entrypoint.d/101-uid-gid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ set_uid() {
if [ -d "/etc/supervisor/custom.d" ]; then
run "chown -R ${username} /etc/supervisor/custom.d" "${debug}"
fi
if [ -d "/opt/nvm" ]; then
run "chown -R ${username} /opt/nvm" "${debug}"
fi
fi
fi
}
Expand Down Expand Up @@ -125,9 +122,6 @@ set_gid() {
if [ -d "/etc/supervisor/custom.d" ]; then
run "chown -R :${groupname} /etc/supervisor/custom.d" "${debug}"
fi
if [ -d "/opt/nvm" ]; then
run "chown -R :${groupname} /opt/nvm" "${debug}"
fi
fi
fi
}
Expand Down
4 changes: 4 additions & 0 deletions Dockerfiles/work/Dockerfile-5.2
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ RUN set -eux \
&& su -c '. /opt/nvm/nvm.sh; nvm install --lts' devilbox \
&& su -c '. /opt/nvm/nvm.sh; nvm use --lts' devilbox \
&& su -c '. /opt/nvm/nvm.sh; corepack enable' devilbox \
\
&& chmod 0777 /opt/nvm \
&& find /opt/nvm -type f -print0 | xargs -n1 -0 chmod go+w \
&& find /opt/nvm -type d -print0 | xargs -n1 -0 chmod 0777 \
\
\
# -------------------- pgsql_client --------------------
Expand Down
4 changes: 4 additions & 0 deletions Dockerfiles/work/Dockerfile-5.3
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ RUN set -eux \
&& su -c '. /opt/nvm/nvm.sh; nvm install --lts' devilbox \
&& su -c '. /opt/nvm/nvm.sh; nvm use --lts' devilbox \
&& su -c '. /opt/nvm/nvm.sh; corepack enable' devilbox \
\
&& chmod 0777 /opt/nvm \
&& find /opt/nvm -type f -print0 | xargs -n1 -0 chmod go+w \
&& find /opt/nvm -type d -print0 | xargs -n1 -0 chmod 0777 \
\
\
# -------------------- pgsql_client --------------------
Expand Down
4 changes: 4 additions & 0 deletions Dockerfiles/work/Dockerfile-5.4
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ RUN set -eux \
&& su -c '. /opt/nvm/nvm.sh; nvm install --lts' devilbox \
&& su -c '. /opt/nvm/nvm.sh; nvm use --lts' devilbox \
&& su -c '. /opt/nvm/nvm.sh; corepack enable' devilbox \
\
&& chmod 0777 /opt/nvm \
&& find /opt/nvm -type f -print0 | xargs -n1 -0 chmod go+w \
&& find /opt/nvm -type d -print0 | xargs -n1 -0 chmod 0777 \
\
\
# -------------------- pgsql_client --------------------
Expand Down
4 changes: 4 additions & 0 deletions Dockerfiles/work/Dockerfile-5.5
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ RUN set -eux \
&& su -c '. /opt/nvm/nvm.sh; nvm install --lts' devilbox \
&& su -c '. /opt/nvm/nvm.sh; nvm use --lts' devilbox \
&& su -c '. /opt/nvm/nvm.sh; corepack enable' devilbox \
\
&& chmod 0777 /opt/nvm \
&& find /opt/nvm -type f -print0 | xargs -n1 -0 chmod go+w \
&& find /opt/nvm -type d -print0 | xargs -n1 -0 chmod 0777 \
\
\
# -------------------- pgsql_client --------------------
Expand Down
4 changes: 4 additions & 0 deletions Dockerfiles/work/Dockerfile-5.6
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ RUN set -eux \
&& su -c '. /opt/nvm/nvm.sh; nvm install --lts' devilbox \
&& su -c '. /opt/nvm/nvm.sh; nvm use --lts' devilbox \
&& su -c '. /opt/nvm/nvm.sh; corepack enable' devilbox \
\
&& chmod 0777 /opt/nvm \
&& find /opt/nvm -type f -print0 | xargs -n1 -0 chmod go+w \
&& find /opt/nvm -type d -print0 | xargs -n1 -0 chmod 0777 \
\
\
# -------------------- pgsql_client --------------------
Expand Down
4 changes: 4 additions & 0 deletions Dockerfiles/work/Dockerfile-7.0
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ RUN set -eux \
&& su -c '. /opt/nvm/nvm.sh; nvm install --lts' devilbox \
&& su -c '. /opt/nvm/nvm.sh; nvm use --lts' devilbox \
&& su -c '. /opt/nvm/nvm.sh; corepack enable' devilbox \
\
&& chmod 0777 /opt/nvm \
&& find /opt/nvm -type f -print0 | xargs -n1 -0 chmod go+w \
&& find /opt/nvm -type d -print0 | xargs -n1 -0 chmod 0777 \
\
\
# -------------------- pgsql_client --------------------
Expand Down
4 changes: 4 additions & 0 deletions Dockerfiles/work/Dockerfile-7.1
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ RUN set -eux \
&& su -c '. /opt/nvm/nvm.sh; nvm install --lts' devilbox \
&& su -c '. /opt/nvm/nvm.sh; nvm use --lts' devilbox \
&& su -c '. /opt/nvm/nvm.sh; corepack enable' devilbox \
\
&& chmod 0777 /opt/nvm \
&& find /opt/nvm -type f -print0 | xargs -n1 -0 chmod go+w \
&& find /opt/nvm -type d -print0 | xargs -n1 -0 chmod 0777 \
\
\
# -------------------- pgsql_client --------------------
Expand Down
4 changes: 4 additions & 0 deletions Dockerfiles/work/Dockerfile-7.2
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ RUN set -eux \
&& su -c '. /opt/nvm/nvm.sh; nvm install --lts' devilbox \
&& su -c '. /opt/nvm/nvm.sh; nvm use --lts' devilbox \
&& su -c '. /opt/nvm/nvm.sh; corepack enable' devilbox \
\
&& chmod 0777 /opt/nvm \
&& find /opt/nvm -type f -print0 | xargs -n1 -0 chmod go+w \
&& find /opt/nvm -type d -print0 | xargs -n1 -0 chmod 0777 \
\
\
# -------------------- pgsql_client --------------------
Expand Down
4 changes: 4 additions & 0 deletions Dockerfiles/work/Dockerfile-7.3
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ RUN set -eux \
&& su -c '. /opt/nvm/nvm.sh; nvm install --lts' devilbox \
&& su -c '. /opt/nvm/nvm.sh; nvm use --lts' devilbox \
&& su -c '. /opt/nvm/nvm.sh; corepack enable' devilbox \
\
&& chmod 0777 /opt/nvm \
&& find /opt/nvm -type f -print0 | xargs -n1 -0 chmod go+w \
&& find /opt/nvm -type d -print0 | xargs -n1 -0 chmod 0777 \
\
\
# -------------------- pgsql_client --------------------
Expand Down
4 changes: 4 additions & 0 deletions Dockerfiles/work/Dockerfile-7.4
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ RUN set -eux \
&& su -c '. /opt/nvm/nvm.sh; nvm install --lts' devilbox \
&& su -c '. /opt/nvm/nvm.sh; nvm use --lts' devilbox \
&& su -c '. /opt/nvm/nvm.sh; corepack enable' devilbox \
\
&& chmod 0777 /opt/nvm \
&& find /opt/nvm -type f -print0 | xargs -n1 -0 chmod go+w \
&& find /opt/nvm -type d -print0 | xargs -n1 -0 chmod 0777 \
\
\
# -------------------- pgsql_client --------------------
Expand Down
4 changes: 4 additions & 0 deletions Dockerfiles/work/Dockerfile-8.0
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ RUN set -eux \
&& su -c '. /opt/nvm/nvm.sh; nvm install --lts' devilbox \
&& su -c '. /opt/nvm/nvm.sh; nvm use --lts' devilbox \
&& su -c '. /opt/nvm/nvm.sh; corepack enable' devilbox \
\
&& chmod 0777 /opt/nvm \
&& find /opt/nvm -type f -print0 | xargs -n1 -0 chmod go+w \
&& find /opt/nvm -type d -print0 | xargs -n1 -0 chmod 0777 \
\
\
# -------------------- pgsql_client --------------------
Expand Down
4 changes: 4 additions & 0 deletions Dockerfiles/work/Dockerfile-8.1
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ RUN set -eux \
&& su -c '. /opt/nvm/nvm.sh; nvm install --lts' devilbox \
&& su -c '. /opt/nvm/nvm.sh; nvm use --lts' devilbox \
&& su -c '. /opt/nvm/nvm.sh; corepack enable' devilbox \
\
&& chmod 0777 /opt/nvm \
&& find /opt/nvm -type f -print0 | xargs -n1 -0 chmod go+w \
&& find /opt/nvm -type d -print0 | xargs -n1 -0 chmod 0777 \
\
\
# -------------------- pgsql_client --------------------
Expand Down
4 changes: 4 additions & 0 deletions Dockerfiles/work/Dockerfile-8.2
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ RUN set -eux \
&& su -c '. /opt/nvm/nvm.sh; nvm install --lts' devilbox \
&& su -c '. /opt/nvm/nvm.sh; nvm use --lts' devilbox \
&& su -c '. /opt/nvm/nvm.sh; corepack enable' devilbox \
\
&& chmod 0777 /opt/nvm \
&& find /opt/nvm -type f -print0 | xargs -n1 -0 chmod go+w \
&& find /opt/nvm -type d -print0 | xargs -n1 -0 chmod 0777 \
\
\
# -------------------- pgsql_client --------------------
Expand Down
4 changes: 4 additions & 0 deletions build/ansible/group_vars/all/work.yml
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,10 @@ software_available:
su -c '. {{ nvm_home }}/nvm.sh; nvm install {{ node_version }}' devilbox \
&& su -c '. {{ nvm_home }}/nvm.sh; nvm use {{ node_version }}' devilbox \
&& su -c '. {{ nvm_home }}/nvm.sh; corepack enable' devilbox \
\
&& chmod 0777 {{ nvm_home }} \
&& find {{ nvm_home }} -type f -print0 | xargs -n1 -0 chmod go+w \
&& find {{ nvm_home }} -type d -print0 | xargs -n1 -0 chmod 0777 \
###
### PostgrSQL Command line client
###
Expand Down

0 comments on commit e0cb0c1

Please sign in to comment.