Skip to content

Commit 134fd7d

Browse files
committed
fixup, mkdir home directory first
1 parent 12a0cb2 commit 134fd7d

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

base/c9s-python-3.9/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ FROM quay.io/centos/centos:stream9
44
# but this way it uses a lot less disk space (hundreds of megabytes less)
55
ENV VIRTUAL_ENV="/opt/app-root"
66
ENV PATH="${VIRTUAL_ENV}/bin:${PATH}"
7-
RUN useradd --uid 1001 --gid 0 --create-home --base-dir / --home-dir /opt/app-root/src \
7+
RUN mkdir --parents --mode 0771 "${VIRTUAL_ENV}/src" && chown --recursive 1001:0 ${VIRTUAL_ENV} && \
8+
useradd --uid 1001 --gid 0 --home-dir "${VIRTUAL_ENV}/src" \
89
--comment "Default Application User" --shell /bin/bash default && \
910
dnf install -y python3-pip && dnf clean all && rm -rf /var/cache/yum/*
1011

base/ubi9-python-3.11/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ FROM registry.access.redhat.com/ubi9/ubi:latest
44
# but this way it uses a lot less disk space (hundreds of megabytes less)
55
ENV VIRTUAL_ENV="/opt/app-root"
66
ENV PATH="${VIRTUAL_ENV}/bin:${PATH}"
7-
RUN useradd --uid 1001 --gid 0 --create-home --base-dir / --home-dir /opt/app-root/src \
7+
RUN mkdir --parents --mode 0771 "${VIRTUAL_ENV}/src" && chown --recursive 1001:0 ${VIRTUAL_ENV} && \
8+
useradd --uid 1001 --gid 0 --home-dir "${VIRTUAL_ENV}/src" \
89
--comment "Default Application User" --shell /bin/bash default && \
910
dnf install -y python311-pip && dnf clean all && rm -rf /var/cache/yum/* && \
1011
python3.11 -m venv "${VIRTUAL_ENV}"

base/ubi9-python-3.9/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ FROM registry.access.redhat.com/ubi9/ubi:latest
44
# but this way it uses a lot less disk space (hundreds of megabytes less)
55
ENV VIRTUAL_ENV="/opt/app-root"
66
ENV PATH="${VIRTUAL_ENV}/bin:${PATH}"
7-
RUN useradd --uid 1001 --gid 0 --create-home --base-dir / --home-dir /opt/app-root/src \
7+
RUN mkdir --parents --mode 0771 "${VIRTUAL_ENV}/src" && chown --recursive 1001:0 ${VIRTUAL_ENV} && \
8+
useradd --uid 1001 --gid 0 --home-dir "${VIRTUAL_ENV}/src" \
89
--comment "Default Application User" --shell /bin/bash default && \
910
dnf install -y python3-pip && dnf clean all && rm -rf /var/cache/yum/*
1011

1112
USER 1001
12-
python3.9 -m venv "${VIRTUAL_ENV}"
13+
RUN python3.9 -m venv "${VIRTUAL_ENV}"
1314

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

0 commit comments

Comments
 (0)