1
1
# syntax=docker/dockerfile:1.2
2
2
ARG BUILD_OS=debian
3
3
ARG NGINX_PLUS_VERSION=r26
4
- ARG UBI_VERSION=8
5
4
ARG FILES=
6
5
ARG DEBIAN_VERSION=bullseye-slim
7
6
@@ -81,18 +80,9 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
81
80
# RUN update-ca-certificates
82
81
83
82
84
- # ############################################ Base image for UBI 8 #############################################
85
- FROM redhat/ubi8-minimal AS ubi-base-8
86
-
87
-
88
- # ############################################ Base image for UBI 7 #############################################
89
- FROM registry.access.redhat.com/ubi7/ubi AS ubi-base-7
90
-
91
- RUN yum install -y microdnf
92
-
93
-
94
83
# ############################################ Base image for UBI #############################################
95
- FROM ubi-base-${UBI_VERSION} AS ubi-base
84
+ FROM redhat/ubi8 AS ubi-base
85
+ ARG IC_VERSION
96
86
97
87
SHELL ["/bin/bash" , "-o" , "pipefail" , "-c" ]
98
88
LABEL name="NGINX Ingress Controller" \
@@ -105,7 +95,9 @@ LABEL name="NGINX Ingress Controller" \
105
95
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." \
106
96
io.openshift.tags="nginx,ingress-controller,ingress,controller,kubernetes,openshift"
107
97
108
- RUN microdnf --nodocs install -y shadow-utils ca-certificates \
98
+ RUN dnf --nodocs install -y shadow-utils ca-certificates \
99
+ # temporary fix for CVE-2022-24407
100
+ && dnf --nodocs install -y cyrus-sasl-lib \
109
101
&& groupadd --system --gid 101 nginx \
110
102
&& useradd --system --gid nginx --no-create-home --home-dir /nonexistent --comment "nginx user" --shell /bin/false --uid 101 nginx
111
103
@@ -121,7 +113,7 @@ RUN rpm --import https://nginx.org/keys/nginx_signing.key \
121
113
&& printf "%s\n " "[nginx]" "name=nginx repo" \
122
114
"baseurl=https://nginx.org/packages/mainline/centos/${version}/\$ basearch/" \
123
115
"gpgcheck=1" "enabled=1" "module_hotfixes=true" > /etc/yum.repos.d/nginx.repo \
124
- && microdnf --nodocs install -y nginx-${NGINX_VERSION} \
116
+ && dnf --nodocs install -y nginx-${NGINX_VERSION} \
125
117
&& rm /etc/yum.repos.d/nginx.repo
126
118
127
119
@@ -132,8 +124,8 @@ ARG NGINX_PLUS_VERSION
132
124
RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode=0644 \
133
125
--mount=type=secret,id=nginx-repo.key,dst=/etc/ssl/nginx/nginx-repo.key,mode=0644 \
134
126
rpm --import https://cs.nginx.com/static/keys/nginx_signing.key \
135
- && curl -sS "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 \
136
- && microdnf --nodocs install -y nginx-plus-${NGINX_PLUS_VERSION} nginx-plus-module-njs-${NGINX_PLUS_VERSION}
127
+ && 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 \
128
+ && dnf --nodocs install -y nginx-plus-${NGINX_PLUS_VERSION} nginx-plus-module-njs-${NGINX_PLUS_VERSION}
137
129
138
130
139
131
# ############################################ Base image for UBI with NGINX Plus and App Protect #############################################
@@ -143,16 +135,16 @@ ARG NGINX_PLUS_VERSION
143
135
RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode=0644 \
144
136
--mount=type=secret,id=nginx-repo.key,dst=/etc/ssl/nginx/nginx-repo.key,mode=0644 \
145
137
--mount=type=secret,id=rhel_license,dst=/tmp/rhel_license,mode=0644 \
146
- set -x \
147
- && source /tmp/rhel_license \
148
- && curl -sS https://cs.nginx.com/static/files/app-protect-7.repo > /etc/yum.repos.d/app-protect-7.repo \
138
+ source /tmp/rhel_license \
149
139
&& subscription-manager register --org=${RHEL_ORGANIZATION} --activationkey=${RHEL_ACTIVATION_KEY} || true \
150
- && subscription-manager attach --auto \
151
- && subscription-manager repos --enable rhel-7-server-optional-rpms --enable rhel-7-server-extras-rpms \
152
- && rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
153
- && yum clean all \
154
- && yum install -y nginx-plus-module-appprotect-${NGINX_PLUS_VERSION} $(repoquery app-protect-${NGINX_PLUS_VERSION#r}*) app-protect-attack-signatures app-protect-threat-campaigns \
155
- && rm /etc/yum.repos.d/app-protect-7.repo
140
+ && subscription-manager attach \
141
+ && dnf config-manager --set-enabled codeready-builder-for-rhel-8-x86_64-rpms \
142
+ && dnf --nodocs install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm \
143
+ && curl -fsSL https://cs.nginx.com/static/files/app-protect-8.repo > /etc/yum.repos.d/app-protect-8.repo \
144
+ && dnf --nodocs install -y app-protect-${NGINX_PLUS_VERSION#r}* app-protect-attack-signatures app-protect-threat-campaigns \
145
+ && rm /etc/yum.repos.d/app-protect*.repo \
146
+ && subscription-manager unregister \
147
+ && dnf clean all && rm -rf /var/cache/dnf
156
148
157
149
# Uncomment the lines below if you want to install a custom CA certificate
158
150
# COPY build/*.crt /etc/pki/ca-trust/source/anchors/
0 commit comments