diff --git a/common.manylinux b/common.manylinux index bd9664a..023d7dd 100644 --- a/common.manylinux +++ b/common.manylinux @@ -7,6 +7,8 @@ RUN cd /opt && \ COPY manylinux-common/install-python-packages.sh /usr/local/bin RUN /usr/local/bin/install-python-packages.sh +COPY manylinux-common/pre_exec.sh /dockcross/pre_exec.sh + RUN yum -y install sudo && \ sed -i 's/Defaults requiretty/#Defaults requiretty/' /etc/sudoers && \ visudo -c diff --git a/imagefiles/entrypoint.sh b/imagefiles/entrypoint.sh index a104e30..523ec6d 100755 --- a/imagefiles/entrypoint.sh +++ b/imagefiles/entrypoint.sh @@ -31,6 +31,11 @@ if [[ -n $BUILDER_UID ]] && [[ -n $BUILDER_GID ]]; then cp -r /root/* $HOME/ chown -R $BUILDER_UID:$BUILDER_GID $HOME/* + # Additional updates specific to the image + if [[ -e /dockcross/pre_exec.sh ]]; then + /dockcross/pre_exec.sh + fi + # Run the command as the specified user/group. exec chpst -u :$BUILDER_UID:$BUILDER_GID "$@" else diff --git a/manylinux-common/pre_exec.sh b/manylinux-common/pre_exec.sh new file mode 100755 index 0000000..a871608 --- /dev/null +++ b/manylinux-common/pre_exec.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +for DIR in /opt/python/*/lib/python*/site-packages; do + chown -R $BUILDER_UID:$BUILDER_GID $DIR +done +for DIR in /opt/python/*/bin; do + chown -R $BUILDER_UID:$BUILDER_GID $DIR +done