Skip to content

Commit a14d15f

Browse files
authored
Bump UBI to 8 for all images (#2527)
1 parent 5fb324b commit a14d15f

File tree

3 files changed

+29
-47
lines changed

3 files changed

+29
-47
lines changed

Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -118,19 +118,19 @@ openshift-image-plus: build ## Create Docker image for Ingress Controller (UBI w
118118

119119
.PHONY: openshift-image-nap-plus
120120
openshift-image-nap-plus: build ## Create Docker image for Ingress Controller (UBI with NGINX Plus and App Protect WAF)
121-
$(DOCKER_CMD) $(PLUS_ARGS) --secret id=rhel_license,src=rhel_license --build-arg BUILD_OS=ubi-plus-nap --build-arg UBI_VERSION=7
121+
$(DOCKER_CMD) $(PLUS_ARGS) --secret id=rhel_license,src=rhel_license --build-arg BUILD_OS=ubi-plus-nap
122122

123123
.PHONY: alpine-image-opentracing
124124
alpine-image-opentracing: build ## Create Docker image for Ingress Controller (Alpine with OpenTracing)
125125
$(DOCKER_CMD) --build-arg BUILD_OS=alpine-opentracing
126126

127127
.PHONY: openshift-image-dos-plus
128128
openshift-image-dos-plus: build ## Create Docker image for Ingress Controller (ubi with plus and dos)
129-
$(DOCKER_CMD) $(PLUS_ARGS) $(NAP_ARGS) --secret id=rhel_license,src=rhel_license --build-arg BUILD_OS=ubi-plus-dos --build-arg UBI_VERSION=7
129+
$(DOCKER_CMD) $(PLUS_ARGS) $(NAP_ARGS) --secret id=rhel_license,src=rhel_license --build-arg BUILD_OS=ubi-plus-dos
130130

131131
.PHONY: openshift-image-nap-dos-plus
132132
openshift-image-nap-dos-plus: build ## Create Docker image for Ingress Controller (ubi with plus, nap and dos)
133-
$(DOCKER_CMD) $(PLUS_ARGS) $(NAP_ARGS) --secret id=rhel_license,src=rhel_license --build-arg BUILD_OS=ubi-plus-nap-dos --build-arg UBI_VERSION=7
133+
$(DOCKER_CMD) $(PLUS_ARGS) $(NAP_ARGS) --secret id=rhel_license,src=rhel_license --build-arg BUILD_OS=ubi-plus-nap-dos
134134

135135
.PHONY: debian-image-opentracing
136136
debian-image-opentracing: build ## Create Docker image for Ingress Controller (Debian with OpenTracing)

build/Dockerfile

+21-39
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# syntax=docker/dockerfile:1.3
22
ARG BUILD_OS=debian
33
ARG NGINX_PLUS_VERSION=r26
4-
ARG UBI_VERSION=8
54
ARG DOWNLOAD_TAG=edge
65
ARG DEBIAN_VERSION=bullseye-slim
76

@@ -115,24 +114,9 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
115114
&& rm -rf /var/lib/apt/lists/* \
116115
&& rm /etc/apt/sources.list.d/nginx-app-protect-dos.list
117116

118-
############################################# Base image for UBI 8 #############################################
119-
FROM redhat/ubi8-minimal AS ubi-base-8
120-
121-
# temporary fix for CVE-2021-42574
122-
RUN microdnf upgrade -y libgcc libstdc++
123-
124-
125-
############################################# Base image for UBI 7 #############################################
126-
FROM registry.access.redhat.com/ubi7/ubi AS ubi-base-7
127-
128-
RUN yum install -y microdnf
129-
130-
# temporary fix for CVE-2021-42574
131-
RUN yum upgrade -y binutils
132-
133117

134118
############################################# Base image for UBI #############################################
135-
FROM ubi-base-${UBI_VERSION} AS ubi-base
119+
FROM redhat/ubi8 AS ubi-base
136120
ARG IC_VERSION
137121

138122
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
@@ -146,7 +130,7 @@ LABEL name="NGINX Ingress Controller" \
146130
io.k8s.description="The NGINX Ingress controller is an application that runs in a cluster and configures an HTTP load balancer according to Ingress resources." \
147131
io.openshift.tags="nginx,ingress-controller,ingress,controller,kubernetes,openshift"
148132

149-
RUN microdnf --nodocs install -y shadow-utils ca-certificates \
133+
RUN dnf --nodocs install -y shadow-utils ca-certificates \
150134
&& groupadd --system --gid 101 nginx \
151135
&& useradd --system --gid nginx --no-create-home --home-dir /nonexistent --comment "nginx user" --shell /bin/false --uid 101 nginx
152136

@@ -163,7 +147,7 @@ RUN --mount=type=bind,from=debian,source=/nginx_version,target=/tmp/nginx_versio
163147
&& printf "%s\n" "[nginx]" "name=nginx repo" \
164148
"baseurl=https://nginx.org/packages/mainline/centos/${version}/\$basearch/" \
165149
"gpgcheck=1" "enabled=1" "module_hotfixes=true" > /etc/yum.repos.d/nginx.repo \
166-
&& microdnf --nodocs install -y nginx-${NGINX_VERSION} \
150+
&& dnf --nodocs install -y nginx-${NGINX_VERSION} \
167151
&& rm /etc/yum.repos.d/nginx.repo
168152

169153

@@ -175,7 +159,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
175159
--mount=type=secret,id=nginx-repo.key,dst=/etc/ssl/nginx/nginx-repo.key,mode=0644 \
176160
rpm --import https://cs.nginx.com/static/keys/nginx_signing.key \
177161
&& curl -fsSL "https://cs.nginx.com/static/files/nginx-plus-$(grep -E -o '[0-9]+\.[0-9]+' /etc/redhat-release | cut -d"." -f1).repo" | tr 0 1 > /etc/yum.repos.d/nginx-plus.repo \
178-
&& microdnf --nodocs install -y nginx-plus-${NGINX_PLUS_VERSION} nginx-plus-module-njs-${NGINX_PLUS_VERSION}
162+
&& dnf --nodocs install -y nginx-plus-${NGINX_PLUS_VERSION} nginx-plus-module-njs-${NGINX_PLUS_VERSION}
179163

180164

181165
############################################# Base image for UBI with NGINX Plus and App Protect WAF #############################################
@@ -188,14 +172,13 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
188172
source /tmp/rhel_license \
189173
&& subscription-manager register --org=${RHEL_ORGANIZATION} --activationkey=${RHEL_ACTIVATION_KEY} || true \
190174
&& subscription-manager attach \
191-
&& subscription-manager repos --enable rhel-7-server-optional-rpms --enable rhel-7-server-extras-rpms \
192-
&& curl -fsSL https://cs.nginx.com/static/files/app-protect-7.repo > /etc/yum.repos.d/app-protect-7.repo \
193-
&& yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
194-
&& yum install -y app-protect-${NGINX_PLUS_VERSION#r}* app-protect-attack-signatures app-protect-threat-campaigns \
195-
&& rm /etc/yum.repos.d/app-protect-7.repo \
175+
&& dnf config-manager --set-enabled codeready-builder-for-rhel-8-x86_64-rpms \
176+
&& dnf --nodocs install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm \
177+
&& curl -fsSL https://cs.nginx.com/static/files/app-protect-8.repo > /etc/yum.repos.d/app-protect-8.repo \
178+
&& dnf --nodocs install -y app-protect-${NGINX_PLUS_VERSION#r}* app-protect-attack-signatures app-protect-threat-campaigns \
179+
&& rm /etc/yum.repos.d/app-protect*.repo \
196180
&& subscription-manager unregister \
197-
&& yum clean all && rm -rf /var/cache/yum
198-
181+
&& dnf clean all && rm -rf /var/cache/dnf
199182
# Uncomment the lines below if you want to install a custom CA certificate
200183
# COPY build/*.crt /etc/pki/ca-trust/source/anchors/
201184
# RUN update-ca-trust extract
@@ -211,14 +194,13 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
211194
source /tmp/rhel_license \
212195
&& subscription-manager register --org=${RHEL_ORGANIZATION} --activationkey=${RHEL_ACTIVATION_KEY} || true \
213196
&& subscription-manager attach \
214-
&& subscription-manager repos --enable rhel-7-server-optional-rpms --enable rhel-7-server-extras-rpms \
215-
&& curl -fsSL https://cs.nginx.com/static/files/app-protect-dos-7.repo > /etc/yum.repos.d/app-protect-dos-7.repo \
216-
&& yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
217-
&& yum install -y app-protect-dos-${NGINX_PLUS_VERSION#r}* \
218-
&& rm /etc/yum.repos.d/app-protect-dos-7.repo \
197+
&& dnf config-manager --set-enabled codeready-builder-for-rhel-8-x86_64-rpms \
198+
&& dnf --nodocs install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm \
199+
&& curl -fsSL https://cs.nginx.com/static/files/app-protect-dos-8.repo > /etc/yum.repos.d/app-protect-dos-8.repo \
200+
&& dnf --nodocs install -y app-protect-dos-${NGINX_PLUS_VERSION#r}* \
201+
&& rm /etc/yum.repos.d/app-protect*.repo \
219202
&& subscription-manager unregister \
220-
&& yum clean all && rm -rf /var/cache/yum
221-
203+
&& dnf clean all && rm -rf /var/cache/dnf
222204

223205
############################################# Base image for UBI with NGINX Plus, App Protect WAF and App Protect Dos #############################################
224206
FROM ubi-plus-nap as ubi-plus-nap-dos
@@ -230,12 +212,12 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
230212
source /tmp/rhel_license \
231213
&& subscription-manager register --org=${RHEL_ORGANIZATION} --activationkey=${RHEL_ACTIVATION_KEY} || true \
232214
&& subscription-manager attach \
233-
&& subscription-manager repos --enable rhel-7-server-optional-rpms --enable rhel-7-server-extras-rpms \
234-
&& curl -fsSL https://cs.nginx.com/static/files/app-protect-dos-7.repo > /etc/yum.repos.d/app-protect-dos-7.repo \
235-
&& yum install -y app-protect-dos-${NGINX_PLUS_VERSION#r}* \
236-
&& rm /etc/yum.repos.d/app-protect-dos-7.repo \
215+
&& dnf config-manager --set-enabled codeready-builder-for-rhel-8-x86_64-rpms \
216+
&& curl -fsSL https://cs.nginx.com/static/files/app-protect-dos-8.repo > /etc/yum.repos.d/app-protect-dos-8.repo \
217+
&& dnf --nodocs install -y app-protect-dos-${NGINX_PLUS_VERSION#r}* \
218+
&& rm /etc/yum.repos.d/app-protect*.repo \
237219
&& subscription-manager unregister \
238-
&& yum clean all && rm -rf /var/cache/yum
220+
&& dnf clean all && rm -rf /var/cache/dnf
239221

240222

241223
############################################# Base images containing libs for Opentracing #############################################

docs/content/technical-specifications.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ All images include NGINX 1.21.6.
3333
|Alpine-based image with OpenTracing | ``nginx:1.21.6-alpine``, which is based on ``alpine:3.15`` | NGINX OpenTracing module, OpenTracing library, OpenTracing tracers for Jaeger, Zipkin and Datadog | ``nginx/nginx-ingress:2.1.1-alpine-ot`` | arm/v7, arm64, amd64, ppc64le, s390x |
3434
|Debian-based image | ``nginx:1.21.6``, which is based on ``debian:bullseye-slim`` | | ``nginx/nginx-ingress:2.1.1`` | arm/v7, arm64, amd64, ppc64le, s390x |
3535
|Debian-based image with OpenTracing | ``nginx:1.21.6``, which is based on ``debian:bullseye-slim`` | NGINX OpenTracing module, OpenTracing library, OpenTracing tracers for Jaeger, Zipkin and Datadog | ``nginx/nginx-ingress:2.1.1-ot`` | arm/v7, arm64, amd64, ppc64le, s390x |
36-
|Ubi-based image | ``redhat/ubi8-minimal`` | | ``nginx/nginx-ingress:2.1.1-ubi`` | arm64, amd64, s390x |
36+
|Ubi-based image | ``redhat/ubi8`` | | ``nginx/nginx-ingress:2.1.1-ubi`` | arm64, amd64, s390x |
3737
{{% /table %}}
3838

3939
### Images with NGINX Plus
@@ -51,10 +51,10 @@ NGINX Plus images are available through the F5 Container registry `private-regis
5151
|Debian-based image with App Protect WAF| ``debian:buster-slim`` | NGINX Plus App Protect WAF module; NGINX Plus JavaScript module | `nginx-ic-nap/nginx-plus-ingress:2.1.1` | amd64 |
5252
|Debian-based image with App Protect DoS | ``debian:buster-slim`` | NGINX Plus App Protect DoS module; NGINX Plus JavaScript module | | amd64 |
5353
|Debian-based image with App Protect WAF and DoS | ``debian:buster-slim`` | NGINX Plus App Protect WAF and DoS modules; NGINX Plus JavaScript module | | amd64 |
54-
|Ubi-based image | ``redhat/ubi8-minimal`` | NGINX Plus JavaScript module | `nginx-ic/nginx-plus-ingress:2.1.1-ubi` | arm64, amd64, s390x |
55-
|Ubi-based image with App Protect WAF | ``registry.access.redhat.com/ubi7/ubi`` | NGINX Plus App Protect WAF module; NGINX Plus JavaScript module | `nginx-ic-nap/nginx-plus-ingress:2.1.1-ubi` | amd64 |
56-
|Ubi-based image with App Protect DoS | ``registry.access.redhat.com/ubi7/ubi`` | NGINX Plus App Protect DoS module; NGINX Plus JavaScript module | | amd64 |
57-
|Ubi-based image with App Protect WAF and DoS | ``registry.access.redhat.com/ubi7/ubi`` | NGINX Plus App Protect WAF and DoS modules; NGINX Plus JavaScript module | | amd64 |
54+
|Ubi-based image | ``redhat/ubi8`` | NGINX Plus JavaScript module | `nginx-ic/nginx-plus-ingress:2.1.1-ubi` | arm64, amd64, s390x |
55+
|Ubi-based image with App Protect WAF | ``redhat/ubi8`` | NGINX Plus App Protect WAF module; NGINX Plus JavaScript module | `nginx-ic-nap/nginx-plus-ingress:2.1.1-ubi` | amd64 |
56+
|Ubi-based image with App Protect DoS | ``redhat/ubi8`` | NGINX Plus App Protect DoS module; NGINX Plus JavaScript module | | amd64 |
57+
|Ubi-based image with App Protect WAF and DoS | ``redhat/ubi8`` | NGINX Plus App Protect WAF and DoS modules; NGINX Plus JavaScript module | | amd64 |
5858
{{% /table %}}
5959

6060
We also provide NGINX Plus images through the AWS Marketplace. Please see [Using the AWS Marketplace Ingress Controller Image](/nginx-ingress-controller/installation/using-aws-marketplace-image.md) for details on how to set up the required IAM resources in your EKS cluster.

0 commit comments

Comments
 (0)