mirror of
https://github.com/bensuperpc/dockcross.git
synced 2026-07-26 12:58:09 +02:00
manylinux: add builder group to own python files
The manylinux images can take over a minute to start on spinning disks (not SSDs) because pre_exec.sh is changing the ownership of all the python install directories to be writable by the BUILDER_UID. This is detailed further in #853. I changed the build steps for manylinux images to add a group called `builder`, then change the python directories to be owned by the `builder` group, and group writable. I then changed pre_exec.sh to add BUILDER_USER to the builder group prior to the gosu switch to become BUILDER_USER. The result is that BUILDER_USER is in the `builder` group that can write to the python directories, allowing the user to install python packages without permission denied errors. There was one additional change to support this, and that was the arguments to `gosu` in entrypoint.sh. Previously the arguments were `$BUILDER_UID:BUILDER_GID`, but providing the gid prevents `gosu` from loading additional groups (such as `builder`) from /etc/group. I removed the GID argument to allow `gosu` to pick up additional groups from /etc/group. fixes #853
This commit is contained in:
@@ -1,15 +1,5 @@
|
||||
#!/usr/bin/env 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
|
||||
for DIR in /opt/python/*; do
|
||||
mkdir $DIR/man
|
||||
chown -R $BUILDER_UID:$BUILDER_GID $DIR/man
|
||||
done
|
||||
for DIR in /opt/python/*/share; do
|
||||
chown -R $BUILDER_UID:$BUILDER_GID $DIR
|
||||
done
|
||||
# Add the BUILDER_USER to the builder group so `pip install` doesn't get access
|
||||
# denied errors.
|
||||
usermod -a -G builder $BUILDER_USER
|
||||
|
||||
Reference in New Issue
Block a user