11# Setup defaults for build arguments
2- ARG PLATFORMS ?= linux/amd64
3- ARG BASE_OS ?= registry.access.redhat.com/ubi8/ubi
4- ARG BASE_OS_VERSION ?= 8.10
2+ ARG PLATFORMS= linux/amd64
3+ ARG BASE_IMAGE= registry.access.redhat.com/ubi8/ubi
4+ ARG BASE_IMAGE_VERSION= 8.10
55
66# Build the manager binary
77FROM golang:1.23.0 as builder
@@ -26,20 +26,31 @@ COPY hack hack/
2626# TARGETOS and TARGETARCH are provided(inferred) by buildx via the --platforms flag
2727RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -a -o manager main.go
2828
29- # Use BASE_OS as the base image
30- FROM ${BASE_OS }:${BASE_OS_VERSION }
29+ # Use BASE_IMAGE as the base image
30+ FROM ${BASE_IMAGE }:${BASE_IMAGE_VERSION }
3131
3232ENV OPERATOR=/manager \
3333 USER_UID=1001 \
3434 USER_NAME=nonroot
3535
3636# Install necessary packages and configure user
37- RUN yum -y install shadow-utils && \
38- useradd -ms /bin/bash nonroot -u 1001 && \
39- yum update -y krb5-libs && yum clean all && \
40- yum -y update-minimal --security --sec-severity=Important --sec-severity=Critical && \
41- yum -y update-minimal --security --sec-severity=Moderate && \
42- yum -y update-minimal --security --sec-severity=Low
37+ RUN if grep -q 'Ubuntu' /etc/os-release; then \
38+ apt-get update && \
39+ apt-get install -y --no-install-recommends passwd=1:4.8.1-1ubuntu5.20.04 && \
40+ useradd -ms /bin/bash nonroot -u 1001 && \
41+ apt-get install -y --no-install-recommends krb5-locales=1.17-6ubuntu4.1 && \
42+ apt-get upgrade -y && \
43+ apt-get install -y --no-install-recommends unattended-upgrades=2.3ubuntu0.1 && \
44+ unattended-upgrades -v --security && \
45+ apt-get clean && rm -rf /var/lib/apt/lists/*; \
46+ else \
47+ yum -y install shadow-utils && \
48+ useradd -ms /bin/bash nonroot -u 1001 && \
49+ yum update -y krb5-libs && yum clean all && \
50+ yum -y update-minimal --security --sec-severity=Important --sec-severity=Critical && \
51+ yum -y update-minimal --security --sec-severity=Moderate && \
52+ yum -y update-minimal --security --sec-severity=Low; \
53+ fi
4354
4455# Metadata
4556LABEL name="splunk" \
0 commit comments