@@ -7,21 +7,14 @@ ARG NAP_WAF=false
7
7
# Initial packages setup
8
8
RUN apt-get -y update \
9
9
&& apt-get -y install apt-transport-https lsb-release ca-certificates wget gnupg2 curl debian-archive-keyring \
10
- # NGINX Instance Manager agent setup
11
10
&& mkdir -p /deployment /etc/ssl/nginx \
12
- # Agent installation
13
- && bash -c 'curl -k $NMS_URL/install/nginx-agent | sh' && echo "Agent installed from NMS"
14
-
15
- # Startup script
16
- COPY ./container/start.sh /deployment/
11
+ && addgroup --system --gid 20983 nginx \
12
+ && adduser --system --disabled-login --ingroup nginx --no-create-home --home /nonexistent --gecos "nginx user" --shell /bin/false --uid 20983 nginx
17
13
18
- # Download certificate and key from the customer portal (https://account.f5.com)
19
- # and copy to the build context
14
+ # Use certificate and key from kubernetes secret
20
15
RUN --mount=type=secret,id=nginx-crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode=0644 \
21
16
--mount=type=secret,id=nginx-key,dst=/etc/ssl/nginx/nginx-repo.key,mode=0644 \
22
17
set -x \
23
- # Startup script
24
- && chmod +x /deployment/start.sh && touch /.dockerenv \
25
18
# Install prerequisite packages:
26
19
&& wget -qO - https://cs.nginx.com/static/keys/nginx_signing.key | gpg --dearmor > /usr/share/keyrings/nginx-archive-keyring.gpg \
27
20
&& printf "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] https://pkgs.nginx.com/plus/debian `lsb_release -cs` nginx-plus\n " > /etc/apt/sources.list.d/nginx-plus.list \
@@ -53,7 +46,15 @@ RUN --mount=type=secret,id=nginx-crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode=0644
53
46
54
47
&& groupadd -g 1001 nginx-agent \
55
48
&& usermod root -G nginx-agent \
56
- && usermod nginx -G nginx-agent
49
+ && usermod nginx -G nginx-agent \
50
+
51
+ # NGINX Instance Manager agent installation
52
+ && bash -c 'curl -k $NMS_URL/install/nginx-agent | sh' && echo "Agent installed from NMS"
53
+
54
+ # Startup script
55
+ COPY ./container/start.sh /deployment/
56
+ RUN chmod +x /deployment/start.sh && touch /.dockerenv
57
+
57
58
58
59
EXPOSE 80
59
60
STOPSIGNAL SIGTERM
0 commit comments