File tree Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -5,14 +5,16 @@ FROM quay.io/centos/centos:stream9
5
5
ENV APP_ROOT="/opt/app-root"
6
6
ENV VIRTUAL_ENV="${APP_ROOT}"
7
7
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} && \
9
11
useradd --uid 1001 --gid 0 --no-create-home --home-dir "${APP_ROOT}/src" \
10
12
--comment "Default Application User" --shell /bin/bash default && \
11
13
dnf install -y python3-pip && dnf clean all && rm -rf /var/cache/yum/*
12
14
COPY --from=quay.io/sclorg/s2i-core-c9s:latest /usr/bin/fix-permissions /usr/bin/fix-permissions
13
15
14
16
USER 1001
15
- RUN python3.9 -m venv "${VIRTUAL_ENV}"
17
+ RUN python${PYTHON_VERSION} -m venv "${VIRTUAL_ENV}"
16
18
17
19
LABEL name="odh-notebook-base-centos-stream9-python-3.9" \
18
20
summary="Python 3.9 CentOS Stream 9 base image for ODH notebooks" \
Original file line number Diff line number Diff line change @@ -5,14 +5,16 @@ FROM registry.access.redhat.com/ubi9/ubi:latest
5
5
ENV APP_ROOT="/opt/app-root"
6
6
ENV VIRTUAL_ENV="${APP_ROOT}"
7
7
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} && \
9
11
useradd --uid 1001 --gid 0 --no-create-home --home-dir "${APP_ROOT}/src" \
10
12
--comment "Default Application User" --shell /bin/bash default && \
11
13
dnf install -y python311-pip && dnf clean all && rm -rf /var/cache/yum/* && \
12
14
COPY --from=quay.io/sclorg/s2i-core-c9s:latest /usr/bin/fix-permissions /usr/bin/fix-permissions
13
15
14
16
USER 1001
15
- RUN python3.11 -m venv "${VIRTUAL_ENV}"
17
+ RUN python${PYTHON_VERSION} -m venv "${VIRTUAL_ENV}"
16
18
17
19
LABEL name="odh-notebook-base-ubi9-python-3.11" \
18
20
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
50
52
rm -f /tmp/openshift-client-linux.tar.gz
51
53
52
54
# 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 && \
54
56
fix-permissions /opt/app-root -P
55
57
56
58
WORKDIR /opt/app-root/src
Original file line number Diff line number Diff line change @@ -5,14 +5,16 @@ FROM registry.access.redhat.com/ubi9/ubi:latest
5
5
ENV APP_ROOT="/opt/app-root"
6
6
ENV VIRTUAL_ENV="${APP_ROOT}"
7
7
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} && \
9
11
useradd --uid 1001 --gid 0 --no-create-home --home-dir "${APP_ROOT}/src" \
10
12
--comment "Default Application User" --shell /bin/bash default && \
11
13
dnf install -y python3-pip && dnf clean all && rm -rf /var/cache/yum/*
12
14
COPY --from=quay.io/sclorg/s2i-core-c9s:latest /usr/bin/fix-permissions /usr/bin/fix-permissions
13
15
14
16
USER 1001
15
- RUN python3.9 -m venv "${VIRTUAL_ENV}"
17
+ RUN python${PYTHON_VERSION} -m venv "${VIRTUAL_ENV}"
16
18
17
19
LABEL name="odh-notebook-base-ubi9-python-3.9" \
18
20
summary="Python 3.9 base image for ODH notebooks" \
You can’t perform that action at this time.
0 commit comments