Skip to content

Commit

Permalink
fixups for python 3.11 when it got added
Browse files Browse the repository at this point in the history
  • Loading branch information
jiridanek committed Oct 4, 2024
1 parent 8b2e727 commit 3f0396a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
17 changes: 17 additions & 0 deletions base/c9s-python-3.11/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
FROM quay.io/sclorg/python-311-c9s:c9s

# perform the setup that python image used to do for us
# but this way it uses a lot less disk space (hundreds of megabytes less)
ENV APP_ROOT="/opt/app-root"
ENV HOME="${APP_ROOT}/src"
ENV VIRTUAL_ENV="${APP_ROOT}"
ENV PATH="${VIRTUAL_ENV}/bin:${PATH}"
ENV PYTHON_VERSION=3.11
ENV PIP_NO_CACHE_DIR=off
RUN mkdir --parents "${HOME}" && chmod --recursive 0771 ${APP_ROOT} && chown --recursive 1001:0 ${APP_ROOT} && \
useradd --uid 1001 --gid 0 --no-create-home --home-dir "${HOME}" \
--comment "Default Application User" --shell /bin/bash default && \
dnf install -y python311-pip && dnf clean all && rm -rf /var/cache/yum/*
COPY --from=quay.io/sclorg/s2i-core-c9s:latest /usr/bin/fix-permissions /usr/bin/rpm-file-permissions /usr/bin/

USER 1001
RUN python${PYTHON_VERSION} -m venv "${VIRTUAL_ENV}"

LABEL name="odh-notebook-base-centos-stream9-python-3.11" \
summary="Python 3.11 CentOS Stream 9 base image for ODH notebooks" \
description="Base Python 3.11 builder image based on CentOS Stream 9 for ODH notebooks" \
Expand Down
2 changes: 1 addition & 1 deletion base/c9s-python-3.9/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ RUN echo "Installing softwares and packages" && micropipenv install && rm -f ./P
tar -xzvf /tmp/openshift-client-linux.tar.gz oc && \
rm -f /tmp/openshift-client-linux.tar.gz && \
# Fix permissions to support pip in Openshift environments \
chmod -R g+w /opt/app-root/lib/python3.9/site-packages && \
chmod -R g+w /opt/app-root/lib/python${PYTHON_VERSION}/site-packages && \
fix-permissions /opt/app-root -P

WORKDIR /opt/app-root/src
4 changes: 2 additions & 2 deletions base/ubi9-python-3.9/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ RUN pip install --no-cache-dir -U "micropipenv[toml]"
# Install Python dependencies from Pipfile.lock file
COPY Pipfile.lock ./

RUN echo "Installing softwares and packages" && micropipenv install && rm -f ./Pipfile.lock
RUN echo "Installing software and packages" && micropipenv install && rm -f ./Pipfile.lock

# OS Packages needs to be installed as root
USER root
Expand All @@ -57,7 +57,7 @@ RUN curl -L https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/clients/oc
rm -f /tmp/openshift-client-linux.tar.gz

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

WORKDIR /opt/app-root/src

0 comments on commit 3f0396a

Please sign in to comment.