-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9f975fc
commit 20bf12f
Showing
2 changed files
with
30 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,31 @@ | ||
|
||
FROM registry.access.redhat.com/ubi8/ubi:8.5-200 as build | ||
FROM registry.access.redhat.com/ubi9/python-312 as build | ||
|
||
ENV \ | ||
APP_ROOT=/opt/app-root \ | ||
# The $HOME is not set by default, but some applications needs this variable | ||
HOME=/opt/app-root \ | ||
PATH=/opt/app-root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | ||
ENV APP_ROOT=/opt/app-root | ||
|
||
WORKDIR ${APP_ROOT} | ||
|
||
RUN INSTALL_PKGS="python38 python38-devel python38-setuptools python38-pip gcc diffutils file make gcc-c++ cmake git" && \ | ||
dnf -y module enable python38:3.8 && \ | ||
dnf -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \ | ||
rpm -V $INSTALL_PKGS && \ | ||
dnf -y clean all --enablerepo='*' | ||
|
||
RUN python3 -m pip install --compile --no-cache-dir --root ${APP_ROOT}/packages kubernetes | ||
RUN echo $(ls -1 ${APP_ROOT}) | ||
RUN mv ${APP_ROOT}/packages/${APP_ROOT}/* ${APP_ROOT}/packages && rm -rf ${APP_ROOT}/packages/opt | ||
|
||
FROM registry.access.redhat.com/ubi8-minimal:8.5-204 as run | ||
FROM registry.access.redhat.com/ubi9-minimal:latest as run | ||
|
||
ENV \ | ||
APP_ROOT=/opt/app-root \ | ||
# The $HOME is not set by default, but some applications needs this variable | ||
HOME=/opt/app-root \ | ||
PATH=/opt/app-root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | ||
PATH=/opt/app-root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | ||
|
||
RUN INSTALL_PKGS="python38" && \ | ||
RUN INSTALL_PKGS="python3.12" && \ | ||
microdnf -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \ | ||
rpm -V $INSTALL_PKGS && \ | ||
microdnf -y clean all --enablerepo='*' | ||
|
||
ENV PYTHONPATH=${APP_ROOT}/.local/lib64/python3.8/site-packages | ||
ENV PYTHONPATH=${APP_ROOT}/.local/lib64/python3.12/site-packages | ||
|
||
WORKDIR ${APP_ROOT} | ||
|
||
COPY --chown=1001 --from=build ${APP_ROOT}/packages/usr/local ./.local | ||
COPY --chown=1001 --from=build ${APP_ROOT}/packages ./.local | ||
COPY --chown=1001 dailyclean.py ${APP_ROOT} | ||
|
||
ENTRYPOINT ["/usr/bin/python3", "dailyclean.py"] | ||
ENTRYPOINT ["/usr/bin/python3.12", "dailyclean.py"] |