This repository has been archived by the owner on Sep 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Dockerfile.test.rhel7
93 lines (78 loc) · 2.97 KB
/
Dockerfile.test.rhel7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Dockerfile.test.rhel
#
# Dockerfile for running tests on RHEL 7. Python3.11 on RHEL 7
# Python3.11 is installed using pyenv.
# The Centos repo files enables access to RPMs required by pip and PyInstaller
# that are not available on the RHEL7 built-in repos (e.g devtools7).
# Base image is RHEL7
FROM registry.access.redhat.com/ubi7/ubi
# Set the install dir env param
ENV INSTALL_DIR=/opt/cyberark-conjur-cli
# Copy below repo files to yum repo dir to make rpms available
COPY ./test/CentOS-SCLo-scl-rh.repo \
./test/CentOS-7-Linux-AppStream.repo \
/etc/yum.repos.d/
# Copy public keys for repo GPG check
RUN curl https://raw.githubusercontent.com/sclorg/centos-release-scl/master/centos-release-scl/RPM-GPG-KEY-CentOS-SIG-SCLo \
> /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo \
&& curl -L https://www.centos.org/keys/RPM-GPG-KEY-CentOS-7 > /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 \
# Import public keys for repo GPG check
&& gpg --import \
/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 \
/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo
# Enable yum repos
RUN yum-config-manager --enable \
ubi-server-rhscl-7-rpms \
ubi-7-server-optional-rpms
RUN yum update -y \
&& yum --disableplugin=subscription-manager \
install -y bash \
wget \
binutils \
yum-utils \
gcc gcc-c++ make \
curl \
jq \
libffi-devel \
gnome-keyring \
procps \
zlib-devel \
bzip2 \
wget \
bzip2-devel \
dbus-x11 \
git \
rh-python38-python-devel \
centos-release-scl \
devtoolset-7 \
&& yum --disableplugin=subscription-manager clean all
# Download, compile and install openssl 1.1.1k since rhel 7 doesn't have an official package for it
RUN wget https://ftp.openssl.org/source/openssl-1.1.1k.tar.gz \
&& tar -xzf openssl-1.1.1k.tar.gz \
&& cd openssl-1.1.1k \
&& ./config --prefix=/usr --openssldir=/etc/ssl --libdir=lib no-shared zlib-dynamic \
&& make \
&& make install
ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64
# Generate unique machne-id file required by dbus-11
RUN dbus-uuidgen > /var/lib/dbus/machine-id
RUN mkdir -p $INSTALL_DIR
WORKDIR $INSTALL_DIR
# Copy project's requirements file
COPY ./requirements.txt $INSTALL_DIR/
# Install Python 3.11 using pyenv, wheel and required libs
ENV PYENV_ROOT="/root/.pyenv"
ENV PATH="$PYENV_ROOT/bin:$PYENV_ROOT/shims:$PATH"
RUN curl -L -s https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash \
&& eval "$(pyenv init --path)" \
&& env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.11 \
&& pyenv global 3.11 \
&& pip install wheel \
&& pip install -r requirements.txt
# Copy script files
COPY ./bin/build_integrations_tests_runner ./test/configure_test_executor.sh /
COPY . $INSTALL_DIR
# Required by PyInstaller
RUN scl enable devtoolset-7 bash
RUN ldconfig /usr/local/lib
ENTRYPOINT ["./test/configure_test_executor.sh"]