diff --git a/base/centos-7/install.sh b/base/centos-7/install.sh index 0d2c2873..ae8e4e33 100755 --- a/base/centos-7/install.sh +++ b/base/centos-7/install.sh @@ -47,3 +47,7 @@ rm -rf /etc/security/limits.d/20-nproc.conf # Clean yum clean all rm -rf /anaconda-post.log /var/log/anaconda/* + +# symlink for python3 +ln -s /bin/python3 /bin/python +ln -sf /usr/bin/pip3.7 /usr/bin/pip3 diff --git a/base/centos-8/install.sh b/base/centos-8/install.sh index ebcd7dda..af1f69d2 100755 --- a/base/centos-8/install.sh +++ b/base/centos-8/install.sh @@ -49,6 +49,7 @@ echo " # symlink for python3 ln -s /bin/python3 /bin/python +ln -sf /usr/bin/pip3.7 /usr/bin/pip3 # Clean yum clean all diff --git a/base/debian-10/install.sh b/base/debian-10/install.sh index 28bdb290..d8357bac 100755 --- a/base/debian-10/install.sh +++ b/base/debian-10/install.sh @@ -92,3 +92,7 @@ chmod u+s /bin/ping # Clean apt clean autoclean rm -rf /var/lib/apt/lists/* + +# Symlink python/pip +ln -sf /usr/bin/python3.7 /usr/bin/python3 +ln -sf /usr/bin/pip3.7 /usr/bin/pip3 \ No newline at end of file diff --git a/base/debian-9/install.sh b/base/debian-9/install.sh index 7c074cc8..12dc0ef2 100755 --- a/base/debian-9/install.sh +++ b/base/debian-9/install.sh @@ -93,3 +93,7 @@ chmod u+s /bin/ping # Clean apt clean autoclean rm -rf /var/lib/apt/lists/* + +# Symlink python/pip +ln -sf /usr/bin/python3.7 /usr/bin/python3 +ln -sf /usr/bin/pip3.7 /usr/bin/pip3 diff --git a/base/redhat-8/Dockerfile b/base/redhat-8/Dockerfile index 2f71cb49..d839e582 100644 --- a/base/redhat-8/Dockerfile +++ b/base/redhat-8/Dockerfile @@ -28,8 +28,8 @@ LABEL name="splunk" \ ARG BUSYBOX_URL ENV BUSYBOX_URL=${BUSYBOX_URL} \ - PYTHON_VERSION=3.7.16 \ - PYTHON_GPG_KEY_ID=0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D + PYTHON_VERSION=3.9.19 \ + PYTHON_GPG_KEY_ID=E3FF2839C048B25C084DEBE9B26995E310250568 COPY install.sh /install.sh diff --git a/base/redhat-8/install.sh b/base/redhat-8/install.sh index 63e7950c..790f7217 100755 --- a/base/redhat-8/install.sh +++ b/base/redhat-8/install.sh @@ -17,7 +17,8 @@ set -e # Generate UTF-8 char map and locale # Reinstalling local English def for now, removed in minimal image: https://bugzilla.redhat.com/show_bug.cgi?id=1665251 -microdnf -y --nodocs install glibc-langpack-en +# Comment below install until glibc update is available in minimal image: https://access.redhat.com/errata/RHSA-2024:2722 +#microdnf -y --nodocs install glibc-langpack-en # Currently there is no access to the UTF-8 char map. The following command is commented out until # the base container can generate the locale. @@ -71,10 +72,12 @@ make altinstall LDFLAGS="-Wl,--strip-all" rm -rf /tmp/pyinstall ln -sf /usr/bin/python${PY_SHORT} /usr/bin/python ln -sf /usr/bin/pip${PY_SHORT} /usr/bin/pip +ln -sf /usr/bin/python${PY_SHORT} /usr/bin/python3 +ln -sf /usr/bin/pip${PY_SHORT} /usr/bin/pip3 # Install splunk-ansible dependencies cd / -/usr/bin/python3.7 -m pip install --upgrade pip +/usr/bin/python3.9 -m pip install --upgrade pip 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 # Remove tests packaged in python libs diff --git a/py23-image/centos-7/Dockerfile b/py23-image/centos-7/Dockerfile index 04a439f6..0811f0dc 100644 --- a/py23-image/centos-7/Dockerfile +++ b/py23-image/centos-7/Dockerfile @@ -17,8 +17,7 @@ RUN wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz \ && python3.7 get-pip.py \ && rm -f get-pip.py \ #pip version is not automatically "fixed", unlike debian-based - && ln -sf /usr/bin/pip2 /usr/bin/pip \ - && ln -sf /usr/bin/pip3.7 /usr/bin/pip3 + && ln -sf /usr/bin/pip2 /usr/bin/pip RUN yum remove -y --setopt=tsflags=noscripts gcc openssl-devel bzip2-devel libffi-devel \ && yum autoremove -y \ && yum clean all diff --git a/py23-image/centos-8/Dockerfile b/py23-image/centos-8/Dockerfile index db936b26..6562f180 100644 --- a/py23-image/centos-8/Dockerfile +++ b/py23-image/centos-8/Dockerfile @@ -18,8 +18,7 @@ RUN wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz \ && python3.7 get-pip.py \ && rm -f get-pip.py \ # pip version is not automatically "fixed", unlike debian-based - && ln -sf /usr/bin/pip2 /usr/bin/pip \ - && ln -sf /usr/bin/pip3.7 /usr/bin/pip3 + && ln -sf /usr/bin/pip2 /usr/bin/pip # add python alias # && ln -s /bin/python3 /bin/python diff --git a/py23-image/debian-10/Dockerfile b/py23-image/debian-10/Dockerfile index 8ff6d359..bae3f1c2 100644 --- a/py23-image/debian-10/Dockerfile +++ b/py23-image/debian-10/Dockerfile @@ -4,8 +4,6 @@ USER root RUN apt-get update -y \ && apt-get install -y --no-install-recommends libpython-dev python-pip python-requests python-jmespath python-yaml \ - && ln -sf /usr/bin/python3.7 /usr/bin/python3 \ - && ln -sf /usr/bin/pip3.7 /usr/bin/pip3 \ && ln -sf /usr/bin/python3.7 /usr/bin/python \ && ln -sf /usr/bin/pip3.7 /usr/bin/pip \ && pip3 install --upgrade ansible==3.4.0 requests==2.25.1 pyyaml==5.4.1 jmespath==0.10.0 diff --git a/py23-image/debian-9/Dockerfile b/py23-image/debian-9/Dockerfile index 69779918..acbd13d2 100644 --- a/py23-image/debian-9/Dockerfile +++ b/py23-image/debian-9/Dockerfile @@ -4,8 +4,6 @@ USER root RUN apt-get update -y \ && apt-get install -y --no-install-recommends libpython-dev python-pip python-requests python-jmespath python-yaml \ - && ln -sf /usr/bin/python3.7 /usr/bin/python3 \ - && ln -sf /usr/bin/pip3.7 /usr/bin/pip3 \ && ln -sf /usr/bin/python3.7 /usr/bin/python \ && ln -sf /usr/bin/pip3.7 /usr/bin/pip \ && pip3 install --upgrade ansible==3.4.0 requests==2.25.1 pyyaml==5.4.1 jmespath==0.10.0 diff --git a/py23-image/redhat-8/Dockerfile b/py23-image/redhat-8/Dockerfile index 89676579..deb0a063 100644 --- a/py23-image/redhat-8/Dockerfile +++ b/py23-image/redhat-8/Dockerfile @@ -3,10 +3,9 @@ FROM ${SPLUNK_PRODUCT}-redhat-8:latest USER root RUN microdnf -y --nodocs update \ - && microdnf -y --nodocs install python2-pip python2-devel \ + && microdnf -y --nodocs install python2 \ + && pip2 install --upgrade pip \ && pip2 --no-cache-dir install requests pyyaml jmespath \ - && ln -sf /usr/bin/python3.7 /usr/bin/python3 \ - && ln -sf /usr/bin/pip3.7 /usr/bin/pip3 \ - && ln -sf /usr/bin/python3.7 /usr/bin/python \ - && ln -sf /usr/bin/pip3.7 /usr/bin/pip \ - && pip3 install --upgrade ansible==3.4.0 requests==2.25.1 pyyaml==5.4.1 jmespath==0.10.0 + && ln -sf /usr/bin/python3.9 /usr/bin/python \ + && ln -sf /usr/bin/pip3.9 /usr/bin/pip \ + && pip3 install --upgrade requests==2.25.1 pyyaml==5.4.1 jmespath==0.10.0 diff --git a/splunk/common-files/Dockerfile b/splunk/common-files/Dockerfile index 7338c52a..809c09c3 100644 --- a/splunk/common-files/Dockerfile +++ b/splunk/common-files/Dockerfile @@ -112,6 +112,7 @@ RUN sed -i -e 's/%sudo\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%sudo ALL=NOPASSWD:ALL\nans && chgrp ${ANSIBLE_GROUP} ${SPLUNK_ANSIBLE_HOME} ${SPLUNK_ANSIBLE_HOME}/ansible.cfg \ && chmod 775 ${SPLUNK_ANSIBLE_HOME} \ && chmod 664 ${SPLUNK_ANSIBLE_HOME}/ansible.cfg \ + && sed -i '/^\[defaults\]/a\interpreter_python = /usr/bin/python3' ${SPLUNK_ANSIBLE_HOME}/ansible.cfg \ && chmod 755 /sbin/entrypoint.sh /sbin/createdefaults.py /sbin/checkstate.sh USER ${ANSIBLE_USER} diff --git a/uf/common-files/Dockerfile b/uf/common-files/Dockerfile index 785de0eb..0048eae1 100644 --- a/uf/common-files/Dockerfile +++ b/uf/common-files/Dockerfile @@ -105,6 +105,7 @@ RUN sed -i -e 's/%sudo\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%sudo ALL=NOPASSWD:ALL\nans && chgrp ${ANSIBLE_GROUP} ${SPLUNK_ANSIBLE_HOME} ${SPLUNK_ANSIBLE_HOME}/ansible.cfg \ && chmod 775 ${SPLUNK_ANSIBLE_HOME} \ && chmod 664 ${SPLUNK_ANSIBLE_HOME}/ansible.cfg \ + && sed -i '/^\[defaults\]/a\interpreter_python = /usr/bin/python3' ${SPLUNK_ANSIBLE_HOME}/ansible.cfg \ && chmod 755 /sbin/entrypoint.sh /sbin/createdefaults.py /sbin/checkstate.sh USER ${ANSIBLE_USER}