-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile.prebuilt
27 lines (26 loc) · 1.08 KB
/
Dockerfile.prebuilt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# syntax=docker/dockerfile:1.13
FROM redhat/ubi9-minimal:9.5 AS final
ARG NGINX
ARG NJS
ENV NGINX_VERSION=${NGINX}
ENV NJS_VERSION=${NJS}
RUN rpm -qa --queryformat "%{NAME}\n" | sort > installed \
&& microdnf --nodocs install -y shadow-utils diffutils \
&& groupadd --system --gid 101 nginx \
&& useradd --system --gid nginx --no-create-home --home-dir /nonexistent --comment "nginx user" --shell /bin/false --uid 101 nginx \
&& rpm -qa --queryformat "%{NAME}\n" | sort > new \
&& microdnf remove -y $(comm -13 installed new) \
# prebuilt nginx rpm
&& rpm --import https://nginx.org/keys/nginx_signing.key \
&& printf "%s\n" "[nginx]" "name=nginx repo" \
"baseurl=https://nginx.org/packages/mainline/centos/9/\$basearch/" \
"gpgcheck=1" "enabled=1" "module_hotfixes=true" > /etc/yum.repos.d/nginx.repo \
&& nginxPackages=" \
nginx-${NGINX_VERSION} \
nginx-module-xslt-${NGINX_VERSION} \
nginx-module-image-filter-${NGINX_VERSION} \
nginx-module-njs-${NGINX_VERSION}+${NJS_VERSION} \
" \
&& microdnf install -y ${nginxPackages} \
&& rm /etc/yum.repos.d/nginx.repo \
&& microdnf clean all