File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8787
8888echo " using image id $IMAGEID "
8989
90+ # Run as CONTAINER_USER_UID in container by default
91+ USER_ARGS=" --user $CONTAINER_USER_UID "
92+ # It is necessary to preserve user namespaces in container on podman to avoid
93+ # root-owned repo contents in bind mount.
94+ if ${DOCKER_BIN} version | grep -q -i " podman" ; then
95+ USER_ARGS=" $USER_ARGS --userns=keep-id"
96+ fi
97+ echo " using user args $USER_ARGS "
98+
9099# execute python within the image passing the supplied arguments
91100
92101${DOCKER_BIN} run -it --rm \
93102 --mount " type=bind,source=$MIG_BASE ,target=/usr/src/app" \
94103 --env " PYTHONPATH=$PYTHONPATH " \
95104 --env " PYTHONPYCACHEPREFIX=$PYTHONPYCACHEPREFIX " \
96105 --env " MIG_ENV=$MIG_ENV " \
97- --user " $CONTAINER_USER_UID " \
106+ ${USER_ARGS} \
98107 " $IMAGEID " " $DOCKER_PYTHON_BIN " $@
You can’t perform that action at this time.
0 commit comments