Skip to content

Commit 285ceef

Browse files
committed
Use nginxcontrib/nginx-ubi as base image for UBI
1 parent 1070031 commit 285ceef

File tree

3 files changed

+10
-28
lines changed

3 files changed

+10
-28
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ jobs:
354354
platforms: ["linux/arm, linux/arm64, linux/amd64, linux/ppc64le, linux/s390x"]
355355
include:
356356
- image: ubi
357-
platforms: "linux/arm64, linux/amd64, linux/s390x"
357+
platforms: "linux/arm64, linux/amd64, linux/ppc64le, linux/s390x"
358358
steps:
359359
- name: Checkout Repository
360360
uses: actions/checkout@v3

build/Dockerfile

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ RUN --mount=type=bind,from=opentracing-lib,target=/tmp/ot/ \
2121
&& rm -rf /var/lib/apt/lists/* \
2222
&& cp -av /tmp/ot/usr/local/lib/libopentracing.so* /tmp/ot/usr/local/lib/libjaegertracing*so* /tmp/ot/usr/local/lib/libzipkin*so* /tmp/ot/usr/local/lib/libdd*so* /tmp/ot/usr/local/lib/libyaml*so* /usr/local/lib/ \
2323
&& cp -av /tmp/ot/usr/lib/nginx/modules/ngx_http_opentracing_module.so /usr/lib/nginx/modules/ \
24-
&& ldconfig \
25-
&& echo $NGINX_VERSION > nginx_version
24+
&& ldconfig
2625

2726

2827
############################################# Base image for Alpine #############################################
@@ -114,10 +113,9 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
114113

115114

116115
############################################# Base image for UBI #############################################
117-
FROM redhat/ubi8 AS ubi-base
116+
FROM nginxcontrib/nginx-ubi:1.23.0 AS ubi
118117
ARG IC_VERSION
119118

120-
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
121119
LABEL name="NGINX Ingress Controller" \
122120
maintainer="[email protected]" \
123121
vendor="NGINX Inc" \
@@ -128,36 +126,20 @@ LABEL name="NGINX Ingress Controller" \
128126
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." \
129127
io.openshift.tags="nginx,ingress-controller,ingress,controller,kubernetes,openshift"
130128

131-
RUN dnf --nodocs install -y shadow-utils ca-certificates \
132-
# temp fix for CVE-2022-1271, CVE-2022-22576, CVE-2022-25313, CVE-2022-22576, CVE-2021-40528, CVE-2021-3634, CVE-2022-29824, CVE-2021-4189, CVE-2021-4189, CVE-2022-29824, CVE-2022-1621
133-
&& dnf --nodocs upgrade -y xz-libs curl expat libcurl libgcrypt libssh libssh-config libxml2 platform-python python3-libs python3-libxml2 vim-minimal \
134-
&& groupadd --system --gid 101 nginx \
135-
&& useradd --system --gid nginx --no-create-home --home-dir /nonexistent --comment "nginx user" --shell /bin/false --uid 101 nginx
136-
137129
COPY --link --chown=101:0 LICENSE /licenses/
138130

139131

140-
############################################# Base image for UBI OSS #############################################
141-
FROM ubi-base AS ubi
142-
143-
RUN --mount=type=bind,from=debian,source=/nginx_version,target=/tmp/nginx_version \
144-
export NGINX_VERSION=$(</tmp/nginx_version) \
145-
&& rpm --import https://nginx.org/keys/nginx_signing.key \
146-
&& version=$(grep -E -o '[0-9]+\.[0-9]+' /etc/redhat-release | cut -d"." -f1) \
147-
&& printf "%s\n" "[nginx]" "name=nginx repo" \
148-
"baseurl=https://nginx.org/packages/mainline/centos/${version}/\$basearch/" \
149-
"gpgcheck=1" "enabled=1" "module_hotfixes=true" > /etc/yum.repos.d/nginx.repo \
150-
&& dnf --nodocs install -y nginx-${NGINX_VERSION} \
151-
&& rm /etc/yum.repos.d/nginx.repo
152-
153-
154132
############################################# Base image for UBI with NGINX Plus #############################################
155-
FROM ubi-base AS ubi-plus
133+
FROM redhat/ubi8 AS ubi-plus
156134
ARG NGINX_PLUS_VERSION
157135

136+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
158137
RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode=0644 \
159138
--mount=type=secret,id=nginx-repo.key,dst=/etc/ssl/nginx/nginx-repo.key,mode=0644 \
160-
rpm --import https://cs.nginx.com/static/keys/nginx_signing.key \
139+
dnf --nodocs install -y shadow-utils ca-certificates \
140+
&& groupadd --system --gid 101 nginx \
141+
&& useradd --system --gid nginx --no-create-home --home-dir /nonexistent --comment "nginx user" --shell /bin/false --uid 101 nginx \
142+
&& rpm --import https://cs.nginx.com/static/keys/nginx_signing.key \
161143
&& 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 \
162144
&& sed -i "0,/centos/s;;${NGINX_PLUS_VERSION}/centos;" /etc/yum.repos.d/nginx-plus.repo \
163145
&& dnf --nodocs install -y nginx-plus nginx-plus-module-njs

docs/content/technical-specifications.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ All images include NGINX 1.23.0.
4747
| ---| ---| ---| --- | --- |
4848
|Alpine-based image | ``nginx:1.23.0-alpine``, which is based on ``alpine:3.16`` | NGINX OpenTracing module, OpenTracing library, OpenTracing tracers for Jaeger, Zipkin and Datadog | ``nginx/nginx-ingress:2.3.0-alpine`` | arm/v7, arm64, amd64, ppc64le, s390x |
4949
|Debian-based image | ``nginx:1.23.0``, which is based on ``debian:bullseye-slim`` | NGINX OpenTracing module, OpenTracing library, OpenTracing tracers for Jaeger, Zipkin and Datadog | ``nginx/nginx-ingress:2.3.0`` | arm/v7, arm64, amd64, ppc64le, s390x |
50-
|Ubi-based image | ``redhat/ubi8`` | | ``nginx/nginx-ingress:2.3.0-ubi`` | arm64, amd64, s390x |
50+
|Ubi-based image | ``nginxcontrib/nginx-ubi:1.23.0``, which is based on ``redhat/ubi9-minimal`` | | ``nginx/nginx-ingress:2.3.0-ubi`` | arm64, amd64, ppc64le, s390x |
5151
{{% /table %}}
5252

5353
### Images with NGINX Plus

0 commit comments

Comments
 (0)