fix(docker): fix issue with passed pip args
Safe cat of pip_args.txt in case there are multiple options
Escape references to EXTRA_PIP_INSTALL_ARGS so they are evaluated correctly
@@ -95,15 +95,15 @@ RUN --mount=type=cache,mode=0777,target=/root/.cache/pip \
# else we will try to install from requirements.txt.
RUN --mount=type=cache,mode=0777,target=/root/.cache/pip bash <<EOF
if [ -f {{ __python_pip_args__ }} ]; then
- EXTRA_PIP_INSTALL_ARGS=$(cat {{ __python_pip_args__ }})
+ EXTRA_PIP_INSTALL_ARGS="`cat {{ __python_pip_args__ }}`"
fi
if [ -f {{ __python_requirements_lock__ }} ]; then
echo "Installing pip packages from 'requirements.lock.txt'.."
- {{ bento__pip_cmd }} install -r {{ __python_requirements_lock__ }} -U $EXTRA_PIP_INSTALL_ARGS
+ {{ bento__pip_cmd }} install -r {{ __python_requirements_lock__ }} -U \$EXTRA_PIP_INSTALL_ARGS
else
if [ -f {{ __python_requirements_txt__ }} ]; then
echo "Installing pip packages from 'requirements.txt'.."
- {{ bento__pip_cmd }} install -r {{ __python_requirements_txt__ }} -U $EXTRA_PIP_INSTALL_ARGS
+ {{ bento__pip_cmd }} install -r {{ __python_requirements_txt__ }} -U \$EXTRA_PIP_INSTALL_ARGS
fi
fi
EOF
@@ -112,7 +112,7 @@ EOF
RUN bash <<EOF
if [ -d {{ expands_bento_path("env", "python", "wheels", bento_path=bento__path) }} ]; then
echo "Installing wheels.."
- {{ bento__pip_cmd }} install {{ expands_bento_path("env", "python", "wheels", "*.whl", bento_path=bento__path) }} -U $EXTRA_PIP_INSTALL_ARGS
+ {{ bento__pip_cmd }} install {{ expands_bento_path("env", "python", "wheels", "*.whl", bento_path=bento__path) }} -U \$EXTRA_PIP_INSTALL_ARGS
fi
EOF
