Skip to content

Commit 3b01837

Browse files
committed
fixup, set more s2i env variables
1 parent 269c78f commit 3b01837

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

base/c9s-python-3.9/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@ FROM quay.io/centos/centos:stream9
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.9
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 python3-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.9 -m venv "${VIRTUAL_ENV}"
17+
RUN python${PYTHON_VERSION} -m venv "${VIRTUAL_ENV}"
1618

1719
LABEL name="odh-notebook-base-centos-stream9-python-3.9" \
1820
summary="Python 3.9 CentOS Stream 9 base image for ODH notebooks" \

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
LABEL name="odh-notebook-base-ubi9-python-3.11" \
1820
summary="Python 3.11 base image for ODH notebooks" \
@@ -50,7 +52,7 @@ RUN curl -L https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/clients/oc
5052
rm -f /tmp/openshift-client-linux.tar.gz
5153

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

5658
WORKDIR /opt/app-root/src

base/ubi9-python-3.9/Dockerfile

Lines changed: 4 additions & 2 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.9
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 python3-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.9 -m venv "${VIRTUAL_ENV}"
17+
RUN python${PYTHON_VERSION} -m venv "${VIRTUAL_ENV}"
1618

1719
LABEL name="odh-notebook-base-ubi9-python-3.9" \
1820
summary="Python 3.9 base image for ODH notebooks" \

0 commit comments

Comments
 (0)