Skip to content

Commit 3094d5d

Browse files
committed
Use nginxcontrib/nginx-ubi as base image for UBI
1 parent 17aad37 commit 3094d5d

File tree

3 files changed

+10
-26
lines changed

3 files changed

+10
-26
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ jobs:
345345
platforms: ["linux/arm, linux/arm64, linux/amd64, linux/ppc64le, linux/s390x"]
346346
include:
347347
- image: ubi
348-
platforms: "linux/arm64, linux/amd64, linux/s390x"
348+
platforms: "linux/arm64, linux/amd64, linux/ppc64le, linux/s390x"
349349
steps:
350350
- name: Checkout Repository
351351
uses: actions/checkout@v3

build/Dockerfile

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ RUN --mount=type=bind,from=opentracing-lib,target=/tmp/ot/ \
1919
&& rm -rf /var/lib/apt/lists/* \
2020
&& 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/ \
2121
&& cp -av /tmp/ot/usr/lib/nginx/modules/ngx_http_opentracing_module.so /usr/lib/nginx/modules/ \
22-
&& ldconfig \
23-
&& echo $NGINX_VERSION > nginx_version
22+
&& ldconfig
2423

2524

2625
############################################# Base image for Alpine #############################################
@@ -109,10 +108,9 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
109108

110109

111110
############################################# Base image for UBI #############################################
112-
FROM redhat/ubi8 AS ubi-base
111+
FROM nginxcontrib/nginx-ubi:1.23.1 AS ubi
113112
ARG IC_VERSION
114113

115-
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
116114
LABEL name="NGINX Ingress Controller" \
117115
maintainer="[email protected]" \
118116
vendor="NGINX Inc" \
@@ -123,34 +121,20 @@ LABEL name="NGINX Ingress Controller" \
123121
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." \
124122
io.openshift.tags="nginx,ingress-controller,ingress,controller,kubernetes,openshift"
125123

126-
RUN dnf --nodocs install -y shadow-utils ca-certificates \
127-
&& groupadd --system --gid 101 nginx \
128-
&& useradd --system --gid nginx --no-create-home --home-dir /nonexistent --comment "nginx user" --shell /bin/false --uid 101 nginx
129-
130124
COPY --link --chown=101:0 LICENSE /licenses/
131125

132126

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

131+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
151132
RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode=0644 \
152133
--mount=type=secret,id=nginx-repo.key,dst=/etc/ssl/nginx/nginx-repo.key,mode=0644 \
153-
rpm --import https://cs.nginx.com/static/keys/nginx_signing.key \
134+
dnf --nodocs install -y shadow-utils ca-certificates \
135+
&& groupadd --system --gid 101 nginx \
136+
&& useradd --system --gid nginx --no-create-home --home-dir /nonexistent --comment "nginx user" --shell /bin/false --uid 101 nginx \
137+
&& rpm --import https://cs.nginx.com/static/keys/nginx_signing.key \
154138
&& 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 \
155139
&& sed -i "0,/centos/s;;${NGINX_PLUS_VERSION}/centos;" /etc/yum.repos.d/nginx-plus.repo \
156140
&& 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.1.
4747
| ---| ---| ---| --- | --- |
4848
|Alpine-based image | ``nginx:1.23.1-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.1-alpine`` | arm/v7, arm64, amd64, ppc64le, s390x |
4949
|Debian-based image | ``nginx:1.23.1``, which is based on ``debian:bullseye-slim`` | NGINX OpenTracing module, OpenTracing library, OpenTracing tracers for Jaeger, Zipkin and Datadog | ``nginx/nginx-ingress:2.3.1`` | arm/v7, arm64, amd64, ppc64le, s390x |
50-
|Ubi-based image | ``redhat/ubi8`` | | ``nginx/nginx-ingress:2.3.1-ubi`` | arm64, amd64, s390x |
50+
|Ubi-based image | ``nginxcontrib/nginx-ubi:1.23.1``, which is based on ``redhat/ubi9-minimal`` | | ``nginx/nginx-ingress:2.3.1-ubi`` | arm64, amd64, ppc64le, s390x |
5151
{{% /table %}}
5252

5353
### Images with NGINX Plus

0 commit comments

Comments
 (0)