@@ -33,14 +33,8 @@ ENV TERRAFORM_VERSION=1.4.6 \
3333 RBENV_ROOT=/opt/rbenv \
3434 RBENV_SHELL=bash \
3535 NPM_CONFIG_CAFILE=/etc/pki/ca-trust/extracted/pem/objsign-ca-bundle.pem \
36- UV_INDEX_URL=https://${nexusAuth}@${nexusHost}/repository/pypi-all/simple \
37- PIP_TRUSTED_HOST=${nexusHost} \
38- UV_CA_CERTIFICATE=/etc/ssl/certs/ca-bundle.crt
39-
40-
41- ENV UV_DEFAULT_INDEX=${UV_INDEX_URL} \
42- PIP_INDEX_URL=${UV_INDEX_URL} \
43- PIP_CERT=${UV_CA_CERTIFICATE}
36+ UV_CA_CERTIFICATE=/etc/ssl/certs/ca-bundle.crt \
37+ PIP_CERT=/etc/ssl/certs/ca-bundle.crt
4438
4539ENV INSTALL_PKGS="yum-utils gcc make git-core zlib zlib-devel gcc-c++ patch \
4640 readline \
@@ -72,15 +66,28 @@ RUN set -x \
7266RUN curl -LsSf https://astral.sh/uv/${UV_VERSION}/install.sh | sh && \
7367 mkdir -p $HOME/.config/pip && \
7468 echo "[global]" > $HOME/.config/pip/pip.conf && \
75- echo "index-url = https://${nexusAuth}@${nexusHost}/repository/pypi-all/simple" >> $HOME/.config/pip/pip.conf && \
76- echo "trusted-host = ${nexusHost}" >> $HOME/.config/pip/pip.conf
69+ if [ -n "${nexusHost}" ] && [ -n "${nexusAuth}" ]; then \
70+ echo "index-url = https://${nexusAuth}@${nexusHost}/repository/pypi-all/simple" >> $HOME/.config/pip/pip.conf && \
71+ echo "trusted-host = ${nexusHost}" >> $HOME/.config/pip/pip.conf && \
72+ echo "export UV_DEFAULT_INDEX=https://${nexusAuth}@${nexusHost}/repository/pypi-all/simple" > /etc/profile.d/uv-index.sh; \
73+ else \
74+ echo "export UV_DEFAULT_INDEX=https://pypi.org/simple" > /etc/profile.d/uv-index.sh; \
75+ fi && \
76+ yum -y clean all
7777
7878RUN for pyVersion in 3.8 3.9 3.11; do \
7979 uv python install $pyVersion && \
80- uv pip install --verbose --system --break-system-packages --python $pyVersion --trusted-host ${nexusHost} --prerelease=allow \
81- virtualenv \
82- pycodestyle \
83- -r /tmp/requirements.txt; \
80+ if [ -n "${nexusHost}" ] && [ -n "${nexusAuth}" ]; then \
81+ uv pip install --verbose --system --break-system-packages --python $pyVersion --index-url https://${nexusAuth}@${nexusHost}/repository/pypi-all/simple --trusted-host ${nexusHost} --prerelease=allow \
82+ virtualenv \
83+ pycodestyle \
84+ -r /tmp/requirements.txt; \
85+ else \
86+ uv pip install --verbose --system --break-system-packages --python $pyVersion --prerelease=allow \
87+ virtualenv \
88+ pycodestyle \
89+ -r /tmp/requirements.txt; \
90+ fi; \
8491 done && \
8592 rm -f /tmp/requirements.txt && \
8693 uv python pin 3.11 && \
0 commit comments