Skip to content

Commit

Permalink
Use a script to prep the container build image
Browse files Browse the repository at this point in the history
Signed-off-by: Shreenidhi Shedi <[email protected]>
  • Loading branch information
sshedi committed Dec 2, 2024
1 parent f8cb2a8 commit 178a4fa
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 26 deletions.
14 changes: 3 additions & 11 deletions ci/Dockerfile.fedora
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
FROM fedora:34

RUN dnf -y upgrade
RUN dnf -y install gcc make cmake libcurl-devel rpm-devel rpm-build \
libsolv-devel popt-devel sed createrepo_c glib2-devel expat \
findutils python3-pytest python3-requests python3-urllib3 \
python3-pyOpenSSL python3 python3-devel valgrind gpgme-devel \
expat-devel openssl-devel sqlite-devel rpm-sign which python3-pip \
shadow-utils sudo e2fsprogs util-linux

RUN pip3 install flake8

RUN mkdir -p /var/lib/tdnf
COPY ci/prep.sh /prep.sh
RUN chmod +x /prep.sh
RUN /prep.sh

CMD ["/bin/bash"]
18 changes: 3 additions & 15 deletions ci/Dockerfile.photon
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
FROM photon:latest

RUN tdnf update -y
RUN tdnf remove -y toybox
RUN tdnf install -y --enablerepo=photon-debuginfo \
build-essential cmake curl-devel rpm-build \
libsolv-devel popt-devel sed createrepo_c glib expat-libs \
findutils python3 python3-pip python3-setuptools \
python3-devel valgrind gpgme-devel glibc-debuginfo \
expat-devel openssl-devel zlib-devel sqlite-devel \
python3-requests python3-urllib3 python3-pyOpenSSL \
sudo shadow which e2fsprogs util-linux

# this can to be removed once latest pytest gets published in photon
RUN pip3 install pytest flake8

RUN mkdir -p /var/lib/tdnf
COPY ci/prep.sh /prep.sh
RUN chmod +x /prep.sh
RUN /prep.sh

CMD ["/bin/bash"]
62 changes: 62 additions & 0 deletions ci/prep.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/bin/bash

set -ex

rel_file="/etc/os-release"

common_pkgs=(
cmake
createrepo_c
e2fsprogs
expat-devel
findutils
gpgme-devel
libsolv-devel
openssl-devel
popt-devel
python3-devel
python3-pip
python3-pyOpenSSL
python3-requests
python3-urllib3
rpm-build
sed
sqlite-devel
sudo
util-linux
valgrind
which
)

if grep -qw "Fedora" ${rel_file}; then
fedora_packages=(
${common_pkgs[@]}
gcc
glib2-devel
libcurl-devel
make
python3-pytest
python3-flake8
rpm-devel
rpm-sign
shadow-utils
)
dnf -y upgrade --refresh
dnf -y install ${fedora_packages[@]}
elif grep -qw "Photon" ${rel_file}; then
photon_packages=(
${common_pkgs[@]}
build-essential
curl-devel
glib
glibc-debuginfo
shadow
zlib-devel
)
tdnf -y upgrade --refresh
tdnf remove -y toybox
tdnf -y install --enablerepo=photon-debuginfo ${photon_packages[@]}
pip3 install pytest flake8
fi

mkdir -p /var/lib/tdnf

0 comments on commit 178a4fa

Please sign in to comment.