Skip to content

Commit ebb10fb

Browse files
committed
fixup, set more s2i env variables
1 parent 465bc6d commit ebb10fb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

base/ubi9-python-3.11/Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@ FROM registry.access.redhat.com/ubi9/ubi:latest
55
ENV APP_ROOT="/opt/app-root"
66
ENV VIRTUAL_ENV="${APP_ROOT}"
77
ENV PATH="${VIRTUAL_ENV}/bin:${PATH}"
8-
RUN mkdir --parents --mode 0771 "${APP_ROOT}/src" && chown --recursive 1001:0 ${APP_ROOT} && \
8+
ENV PYTHON_VERSION=3.11
9+
ENV PIP_NO_CACHE_DIR=off
10+
RUN mkdir --parents "${APP_ROOT}/src" && chmod --recursive 0771 ${APP_ROOT} && chown --recursive 1001:0 ${APP_ROOT} && \
911
useradd --uid 1001 --gid 0 --no-create-home --home-dir "${APP_ROOT}/src" \
1012
--comment "Default Application User" --shell /bin/bash default && \
1113
dnf install -y python311-pip && dnf clean all && rm -rf /var/cache/yum/* && \
1214
COPY --from=quay.io/sclorg/s2i-core-c9s:latest /usr/bin/fix-permissions /usr/bin/fix-permissions
1315

1416
USER 1001
15-
RUN python3.11 -m venv "${VIRTUAL_ENV}"
17+
RUN python${PYTHON_VERSION} -m venv "${VIRTUAL_ENV}"
1618

1719
ARG SOURCE_CODE=base/ubi9-python-3.11
1820

@@ -52,7 +54,7 @@ RUN curl -L https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/clients/oc
5254
rm -f /tmp/openshift-client-linux.tar.gz
5355

5456
# Fix permissions to support pip in Openshift environments
55-
RUN chmod -R g+w /opt/app-root/lib/python3.11/site-packages && \
57+
RUN chmod -R g+w /opt/app-root/lib/python${PYTHON_VERSION}/site-packages && \
5658
fix-permissions /opt/app-root -P
5759

5860
WORKDIR /opt/app-root/src

0 commit comments

Comments
 (0)