Skip to content

Commit

Permalink
chore: use ubi9 in testing dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
psegedy committed Sep 19, 2024
1 parent 2a674aa commit 1f0919d
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
# Build vmaas app with local changes to vmaas-lib
FROM registry.access.redhat.com/ubi8/ubi-minimal

# install postgresql from centos if not building on RHSM system
RUN FULL_RHEL=$(microdnf repolist --enabled | grep rhel-8) ; \
if [ -z "$FULL_RHEL" ] ; then \
rpm -Uvh http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/centos-stream-repos-8-4.el8.noarch.rpm \
http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/centos-gpg-keys-8-4.el8.noarch.rpm && \
sed -i 's/^\(enabled.*\)/\1\npriority=200/;' /etc/yum.repos.d/CentOS*.repo ; \
fi
FROM registry.access.redhat.com/ubi9/ubi-minimal

ARG VAR_RPMS=""
RUN microdnf module enable postgresql:12 && \
microdnf module enable nginx:1.20 && \
microdnf install --setopt=install_weak_deps=0 --setopt=tsflags=nodocs \
python311 python3.11-pip python3-rpm which nginx rpm-devel git-core shadow-utils diffutils systemd libicu postgresql go-toolset \
RUN curl -o /etc/yum.repos.d/postgresql.repo \
https://copr.fedorainfracloud.org/coprs/mmraka/postgresql-16/repo/epel-9/mmraka-postgresql-16-epel-9.repo

RUN microdnf install -y --setopt=install_weak_deps=0 --setopt=tsflags=nodocs \
python311 python3.11-pip python3.11-rpm which nginx rpm-devel git-core shadow-utils diffutils systemd libicu postgresql go-toolset \
$VAR_RPMS && \
ln -s /usr/lib64/python3.6/site-packages/rpm /usr/lib64/python3.11/site-packages/rpm && \
ln -s /usr/lib64/python3.9/site-packages/rpm /usr/lib64/python3.11/site-packages/rpm && \
ln -s $(basename /usr/lib64/python3.9/site-packages/rpm/_rpm.*.so) /usr/lib64/python3.9/site-packages/rpm/_rpm.so && \
microdnf clean all

RUN git clone https://github.com/RedHatInsights/vmaas.git --branch master /vmaas
Expand All @@ -25,10 +19,10 @@ WORKDIR /vmaas
ENV LC_ALL=C.utf8
ENV LANG=C.utf8
ARG VAR_POETRY_INSTALL_OPT="--only main"
RUN pip3 install --upgrade pip && \
pip3 install --upgrade poetry~=1.5
RUN pip3.11 install --upgrade pip && \
pip3.11 install --upgrade poetry~=1.5
RUN poetry export $VAR_POETRY_INSTALL_OPT -f requirements.txt --output requirements.txt && \
pip3 install -r requirements.txt
pip3.11 install -r requirements.txt

RUN install -m 1777 -d /data && \
adduser --gid 0 -d /vmaas --no-create-home vmaas
Expand Down

0 comments on commit 1f0919d

Please sign in to comment.