Skip to content

Commit

Permalink
(RHINENG-12237) Migrate from ubi8-minimal to ubi9-minimal (#2230)
Browse files Browse the repository at this point in the history
Signed-off-by: Gaël Chamoulaud <[email protected]>
  • Loading branch information
strider authored Feb 5, 2025
1 parent 3a2141a commit 8233f01
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
15 changes: 5 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest

ARG pgRepo="https://copr.fedorainfracloud.org/coprs/g/insights/postgresql-16/repo/epel-8/group_insights-postgresql-16-epel-8.repo"
ARG pgRepo="https://copr.fedorainfracloud.org/coprs/g/insights/postgresql-16/repo/epel-9/group_insights-postgresql-16-epel-9.repo"
ARG TEST_IMAGE=false

USER root
Expand All @@ -9,11 +9,10 @@ ENV APP_ROOT=/opt/app-root/src
WORKDIR $APP_ROOT

RUN (microdnf module enable -y postgresql:16 || curl -o /etc/yum.repos.d/postgresql.repo $pgRepo) && \
microdnf module enable python39:3.9 && \
microdnf upgrade -y && \
microdnf install --setopt=tsflags=nodocs -y postgresql python39 rsync tar procps-ng make && \
rpm -qa | sort > packages-before-devel-install.txt && \
microdnf install --setopt=tsflags=nodocs -y libpq-devel python39-devel gcc && \
microdnf install --setopt=tsflags=nodocs -y libpq-devel python3-devel gcc && \
rpm -qa | sort > packages-after-devel-install.txt

COPY api/ api/
Expand Down Expand Up @@ -55,20 +54,16 @@ RUN python3 -m pip install --upgrade pip setuptools wheel && \

# allows pre-commit and unit tests to run successfully within the container if image is built in "test" environment
RUN if [ "$TEST_IMAGE" = "true" ]; then \
microdnf module enable nodejs:20 && \
microdnf module enable -y nodejs:20 && \
microdnf install --setopt=tsflags=nodocs -y git npm which && \
chgrp -R 0 $APP_ROOT && \
chmod -R g=u $APP_ROOT ; \
fi

# remove devel packages that were only necessary for psycopg2 to compile
RUN microdnf remove -y $( comm -13 packages-before-devel-install.txt packages-after-devel-install.txt ) python39-setuptools && \
rm packages-before-devel-install.txt packages-after-devel-install.txt && \
RUN microdnf remove -y libpq-devel python3-devel gcc && \
microdnf clean all

# create a symlink to the library missing from postgresql:16. This may not be needed in future.
RUN ln -s /usr/lib64/libpq.so.private16-5.16 /usr/lib64/libpq.so.5

USER 1001

ENTRYPOINT [ "dumb-init", "./run_command.sh" ]
2 changes: 1 addition & 1 deletion dev.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.access.redhat.com/ubi8/python-38
FROM registry.access.redhat.com/ubi9/python-39

USER 0
# use general package name instead of a specific one,
Expand Down

0 comments on commit 8233f01

Please sign in to comment.