Skip to content

Commit c2560fa

Browse files
use py3.9, resolve CVEs
1 parent 27201c1 commit c2560fa

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

base/redhat-8/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ LABEL name="splunk" \
2828
ARG BUSYBOX_URL
2929

3030
ENV BUSYBOX_URL=${BUSYBOX_URL} \
31-
PYTHON_VERSION=3.8.19 \
31+
PYTHON_VERSION=3.9.19 \
3232
PYTHON_GPG_KEY_ID=E3FF2839C048B25C084DEBE9B26995E310250568
3333

3434
COPY install.sh /install.sh

base/redhat-8/install.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ set -e
1717

1818
# Generate UTF-8 char map and locale
1919
# Reinstalling local English def for now, removed in minimal image: https://bugzilla.redhat.com/show_bug.cgi?id=1665251
20-
microdnf -y --nodocs install glibc-langpack-en
20+
# Comment below install until glibc update is available in minimal image: https://access.redhat.com/errata/RHSA-2024:2722
21+
#microdnf -y --nodocs install glibc-langpack-en
2122

2223
# Currently there is no access to the UTF-8 char map. The following command is commented out until
2324
# the base container can generate the locale.
@@ -74,9 +75,12 @@ ln -sf /usr/bin/pip${PY_SHORT} /usr/bin/pip
7475

7576
# Install splunk-ansible dependencies
7677
cd /
77-
/usr/bin/python3.8 -m pip install --upgrade pip
78+
/usr/bin/python3.9 -m pip install --upgrade pip
7879
pip -q --no-cache-dir install --upgrade "requests_unixsocket<2.29" "requests<2.29" six wheel Mako "urllib3<2.0.0" certifi jmespath future avro cryptography lxml protobuf setuptools ansible
7980

81+
# Avoid vulnerability on old pip version
82+
/usr/libexec/platform-python -m pip install --upgrade pip
83+
8084
# Remove tests packaged in python libs
8185
find /usr/lib/ -depth \( -type d -a -not -wholename '*/ansible/plugins/test' -a \( -name test -o -name tests -o -name idle_test \) \) -exec rm -rf '{}' \;
8286
find /usr/lib/ -depth \( -type f -a -name '*.pyc' -o -name '*.pyo' -o -name '*.a' \) -exec rm -rf '{}' \;

py23-image/redhat-8/Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ FROM ${SPLUNK_PRODUCT}-redhat-8:latest
33
USER root
44

55
RUN microdnf -y --nodocs update \
6-
&& microdnf -y --nodocs install python2-pip python2-devel \
6+
&& microdnf -y --nodocs install python2 \
7+
&& pip2 install --upgrade pip \
78
&& pip2 --no-cache-dir install requests pyyaml jmespath \
8-
&& ln -sf /usr/bin/python3.8 /usr/bin/python3 \
9-
&& ln -sf /usr/bin/pip3.8 /usr/bin/pip3 \
10-
&& ln -sf /usr/bin/python3.8 /usr/bin/python \
11-
&& ln -sf /usr/bin/pip3.8 /usr/bin/pip \
9+
&& ln -sf /usr/bin/python3.9 /usr/bin/python3 \
10+
&& ln -sf /usr/bin/pip3.9 /usr/bin/pip3 \
11+
&& ln -sf /usr/bin/python3.9 /usr/bin/python \
12+
&& ln -sf /usr/bin/pip3.9 /usr/bin/pip \
1213
&& pip3 install --upgrade requests==2.25.1 pyyaml==5.4.1 jmespath==0.10.0 \
1314
&& sed -i '/^\[defaults\]/a\interpreter_python = /usr/bin/python3' /opt/ansible/ansible.cfg

0 commit comments

Comments
 (0)