Skip to content

Commit 552d65e

Browse files
Merge pull request #690 from splunk/redhat-9-spike
add redhat 9
2 parents e753738 + 5366e9a commit 552d65e

File tree

3 files changed

+154
-2
lines changed

3 files changed

+154
-2
lines changed

Makefile

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ base-redhat-8:
7777
base-redhat-8-armv8:
7878
docker buildx build ${DOCKER_BUILD_FLAGS} --build-arg BUSYBOX_URL=${BUSYBOX_URL} --label version=${SPLUNK_VERSION} -t base-redhat-8-armv8:${IMAGE_VERSION} ./base/redhat-8
7979

80+
base-redhat-9:
81+
docker build ${DOCKER_BUILD_FLAGS} --label version=${SPLUNK_VERSION} -t base-redhat-9:${IMAGE_VERSION} ./base/redhat-9
82+
8083
base-windows-2016:
8184
docker build ${DOCKER_BUILD_FLAGS} -t base-windows-2016:${IMAGE_VERSION} ./base/windows-2016
8285

@@ -157,7 +160,7 @@ bare-redhat-8: base-redhat-8
157160
--target bare -t bare-redhat-8:${IMAGE_VERSION} .
158161

159162
##### Splunk images #####
160-
splunk: ansible splunk-debian-9 splunk-debian-10 splunk-centos-7 splunk-centos-8 splunk-redhat-8
163+
splunk: ansible splunk-debian-9 splunk-debian-10 splunk-centos-7 splunk-centos-8 splunk-redhat-8 splunk-redhat-9
161164

162165
splunk-debian-9: base-debian-9 ansible
163166
docker build ${DOCKER_BUILD_FLAGS} \
@@ -194,6 +197,13 @@ splunk-redhat-8: base-redhat-8 ansible
194197
--build-arg SPLUNK_BUILD_URL=${SPLUNK_LINUX_BUILD_URL} \
195198
-t splunk-redhat-8:${IMAGE_VERSION} .
196199

200+
splunk-redhat-9: base-redhat-9 ansible
201+
docker build ${DOCKER_BUILD_FLAGS} \
202+
-f splunk/common-files/Dockerfile \
203+
--build-arg SPLUNK_BASE_IMAGE=base-redhat-9 \
204+
--build-arg SPLUNK_BUILD_URL=${SPLUNK_LINUX_BUILD_URL} \
205+
-t splunk-redhat-9:${IMAGE_VERSION} .
206+
197207
splunk-windows-2016: base-windows-2016 ansible
198208
docker build ${DOCKER_BUILD_FLAGS} \
199209
-f splunk/windows-2016/Dockerfile \
@@ -202,7 +212,7 @@ splunk-windows-2016: base-windows-2016 ansible
202212
-t splunk-windows-2016:${IMAGE_VERSION} .
203213

204214
##### UF images #####
205-
uf: ansible uf-debian-9 uf-debian-10 uf-centos-7 uf-centos-8 uf-redhat-8
215+
uf: ansible uf-debian-9 uf-debian-10 uf-centos-7 uf-centos-8 uf-redhat-8 uf-redhat-9
206216

207217
ufbare-debian-9: base-debian-9 ansible
208218
docker build ${DOCKER_BUILD_FLAGS} \
@@ -260,6 +270,12 @@ uf-redhat-8-armv8: base-redhat-8-armv8 ansible
260270
--build-arg SPLUNK_BUILD_URL=${UF_LINUX_BUILD_URL} \
261271
-t uf-redhat-8-armv8:${IMAGE_VERSION} .
262272

273+
uf-redhat-9: base-redhat-9 ansible
274+
docker build ${DOCKER_BUILD_FLAGS} \
275+
-f uf/common-files/Dockerfile \
276+
--build-arg SPLUNK_BASE_IMAGE=base-redhat-9 \
277+
--build-arg SPLUNK_BUILD_URL=${UF_LINUX_BUILD_URL} \
278+
-t uf-redhat-9:${IMAGE_VERSION} .
263279

264280
uf-windows-2016: base-windows-2016 ansible
265281
docker build ${DOCKER_BUILD_FLAGS} \

base/redhat-9/Dockerfile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copyright 2018-2021 Splunk
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# NOTE that since OpenShift Container Platform 3.11
16+
# the container catalog moved from registry.access.redhat.com to registry.redhat.io
17+
# So at some point before they deprecate the old registry we have to make sure that
18+
# we have access to the new registry and change where we pull the ubi image from.
19+
FROM registry.access.redhat.com/ubi9/ubi-minimal
20+
21+
LABEL name="splunk" \
22+
maintainer="support@splunk.com" \
23+
vendor="splunk" \
24+
release="1" \
25+
summary="UBI 9 Docker image of Splunk Enterprise" \
26+
description="Splunk Enterprise is a platform for operational intelligence. Our software lets you collect, analyze, and act upon the untapped value of big data that your technology infrastructure, security systems, and business applications generate. It gives you insights to drive operational performance and business results."
27+
28+
ARG BUSYBOX_URL
29+
30+
ENV BUSYBOX_URL=${BUSYBOX_URL} \
31+
PYTHON_VERSION=3.9.19 \
32+
PYTHON_GPG_KEY_ID=E3FF2839C048B25C084DEBE9B26995E310250568
33+
34+
COPY install.sh /install.sh
35+
36+
RUN mkdir /licenses \
37+
&& curl -o /licenses/apache-2.0.txt https://www.apache.org/licenses/LICENSE-2.0.txt \
38+
&& curl -o /licenses/EULA_Red_Hat_Universal_Base_Image_English_20190422.pdf https://www.redhat.com/licenses/EULA_Red_Hat_Universal_Base_Image_English_20190422.pdf \
39+
&& /install.sh && rm -rf /install.sh

base/redhat-9/install.sh

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
#!/bin/bash
2+
# Copyright 2018-2021 Splunk
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
set -e
17+
18+
# Generate UTF-8 char map and locale
19+
# Reinstalling local English def for now, removed in minimal image: https://bugzilla.redhat.com/show_bug.cgi?id=1665251
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
22+
23+
# Currently there is no access to the UTF-8 char map. The following command is commented out until
24+
# the base container can generate the locale.
25+
# localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
26+
# We get around the gen above by forcing the language install, and then pointing to it.
27+
export LANG=en_US.utf8
28+
29+
# Install utility packages
30+
microdnf -y --nodocs install wget sudo shadow-utils procps tar make gcc \
31+
openssl-devel libffi-devel findutils libssh-devel \
32+
libcurl-devel ncurses-devel diffutils zlib-devel
33+
# Patch security updates
34+
microdnf -y --nodocs update gnutls kernel-headers libdnf librepo libnghttp2 nettle \
35+
libpwquality libxml2 systemd-libs lz4-libs curl \
36+
rpm rpm-libs sqlite-libs cyrus-sasl-lib vim expat \
37+
openssl-libs xz-libs zlib libsolv file-libs pcre \
38+
libarchive libgcrypt libksba libstdc++ json-c gnupg
39+
40+
# TODO: install busybox via EPEL? Will this even work?
41+
# currently seeing errors when installing/building via source
42+
43+
# Install Python and necessary packages
44+
PY_SHORT=${PYTHON_VERSION%.*}
45+
wget -O /tmp/python.tgz https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz
46+
wget -O /tmp/Python-gpg-sig-${PYTHON_VERSION}.tgz.asc https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz.asc
47+
gpg --keyserver keys.openpgp.org --recv-keys $PYTHON_GPG_KEY_ID \
48+
|| gpg --keyserver pool.sks-keyservers.net --recv-keys $PYTHON_GPG_KEY_ID \
49+
|| gpg --keyserver pgp.mit.edu --recv-keys $PYTHON_GPG_KEY_ID \
50+
|| gpg --keyserver keyserver.pgp.com --recv-keys $PYTHON_GPG_KEY_ID
51+
gpg --verify /tmp/Python-gpg-sig-${PYTHON_VERSION}.tgz.asc /tmp/python.tgz
52+
rm /tmp/Python-gpg-sig-${PYTHON_VERSION}.tgz.asc
53+
mkdir -p /tmp/pyinstall
54+
tar -xzC /tmp/pyinstall/ --strip-components=1 -f /tmp/python.tgz
55+
rm /tmp/python.tgz
56+
cd /tmp/pyinstall
57+
./configure --enable-optimizations --prefix=/usr --with-ensurepip=install
58+
make altinstall LDFLAGS="-Wl,--strip-all"
59+
rm -rf /tmp/pyinstall
60+
ln -sf /usr/bin/python${PY_SHORT} /usr/bin/python
61+
ln -sf /usr/bin/pip${PY_SHORT} /usr/bin/pip
62+
ln -sf /usr/bin/python${PY_SHORT} /usr/bin/python3
63+
ln -sf /usr/bin/pip${PY_SHORT} /usr/bin/pip3
64+
65+
# Install splunk-ansible dependencies
66+
cd /
67+
/usr/bin/python3.9 -m pip install --upgrade pip
68+
pip -q --no-cache-dir install --upgrade requests_unixsocket requests six wheel Mako "urllib3<2.0.0" certifi jmespath future avro cryptography lxml protobuf setuptools ansible
69+
70+
# Remove tests packaged in python libs
71+
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 '{}' \;
72+
find /usr/lib/ -depth \( -type f -a -name '*.pyc' -o -name '*.pyo' -o -name '*.a' \) -exec rm -rf '{}' \;
73+
find /usr/lib/ -depth \( -type f -a -name 'wininst-*.exe' \) -exec rm -rf '{}' \;
74+
ldconfig
75+
76+
# Cleanup
77+
microdnf remove -y make gcc openssl-devel findutils glibc-devel cpp \
78+
libffi-devel libcurl-devel libssh-devel libxcrypt-devel \
79+
ncurses-devel zlib-devel
80+
microdnf clean all
81+
82+
# Enable busybox symlinks
83+
cd /bin
84+
BBOX_LINKS=( clear find diff hostname killall netstat nslookup ping ping6 readline route syslogd tail traceroute vi )
85+
for item in "${BBOX_LINKS[@]}"
86+
do
87+
ln -s busybox $item || true
88+
done
89+
groupadd sudo
90+
91+
echo "
92+
## Allows people in group sudo to run all commands
93+
%sudo ALL=(ALL) ALL" >> /etc/sudoers
94+
95+
# Clean
96+
microdnf clean all
97+
rm -rf /install.sh /anaconda-post.log /var/log/anaconda/*

0 commit comments

Comments
 (0)