File tree Expand file tree Collapse file tree 3 files changed +21
-4
lines changed Expand file tree Collapse file tree 3 files changed +21
-4
lines changed Original file line number Diff line number Diff line change 1
- FROM quay.io/sclorg/python-311-c9s:c9s
1
+ FROM quay.io/centos/centos:stream9
2
+
3
+ # perform the setup that python image used to do for us
4
+ # but this way it uses a lot less disk space (hundreds of megabytes less)
5
+ ENV APP_ROOT="/opt/app-root"
6
+ ENV HOME="${APP_ROOT}/src"
7
+ ENV VIRTUAL_ENV="${APP_ROOT}"
8
+ ENV PATH="${VIRTUAL_ENV}/bin:${PATH}"
9
+ ENV PYTHON_VERSION=3.11
10
+ ENV PIP_NO_CACHE_DIR=off
11
+ RUN mkdir --parents "${HOME}" && chmod --recursive 0771 ${APP_ROOT} && chown --recursive 1001:0 ${APP_ROOT} && \
12
+ useradd --uid 1001 --gid 0 --no-create-home --home-dir "${HOME}" \
13
+ --comment "Default Application User" --shell /bin/bash default && \
14
+ dnf install -y python311-pip && dnf clean all && rm -rf /var/cache/yum/*
15
+ COPY --from=quay.io/sclorg/s2i-core-c9s:latest /usr/bin/fix-permissions /usr/bin/rpm-file-permissions /usr/bin/
16
+
17
+ USER 1001
18
+ RUN python${PYTHON_VERSION} -m venv "${VIRTUAL_ENV}"
2
19
3
20
LABEL name="odh-notebook-base-centos-stream9-python-3.11" \
4
21
summary="Python 3.11 CentOS Stream 9 base image for ODH notebooks" \
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ RUN echo "Installing softwares and packages" && micropipenv install && rm -f ./P
55
55
tar -xzvf /tmp/openshift-client-linux.tar.gz oc && \
56
56
rm -f /tmp/openshift-client-linux.tar.gz && \
57
57
# Fix permissions to support pip in Openshift environments \
58
- chmod -R g+w /opt/app-root/lib/python3.9 /site-packages && \
58
+ chmod -R g+w /opt/app-root/lib/python${PYTHON_VERSION} /site-packages && \
59
59
fix-permissions /opt/app-root -P
60
60
61
61
WORKDIR /opt/app-root/src
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ RUN pip install --no-cache-dir -U "micropipenv[toml]"
35
35
# Install Python dependencies from Pipfile.lock file
36
36
COPY Pipfile.lock ./
37
37
38
- RUN echo "Installing softwares and packages" && micropipenv install && rm -f ./Pipfile.lock
38
+ RUN echo "Installing software and packages" && micropipenv install && rm -f ./Pipfile.lock
39
39
40
40
# OS Packages needs to be installed as root
41
41
USER root
@@ -57,7 +57,7 @@ RUN curl -L https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/clients/oc
57
57
rm -f /tmp/openshift-client-linux.tar.gz
58
58
59
59
# Fix permissions to support pip in Openshift environments
60
- RUN chmod -R g+w /opt/app-root/lib/python3.9 /site-packages && \
60
+ RUN chmod -R g+w /opt/app-root/lib/python${PYTHON_VERSION} /site-packages && \
61
61
fix-permissions /opt/app-root -P
62
62
63
63
WORKDIR /opt/app-root/src
You can’t perform that action at this time.
0 commit comments