1
- FROM ubuntu:16.04
1
+ FROM debian:stretch-slim
2
2
3
- MAINTAINER NGINX Docker Maintainers
" [email protected] "
3
+ LABEL maintainer=" NGINX Docker Maintainers
< [email protected] > "
4
4
5
- # Set the debconf front end to Noninteractive
6
- RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
7
-
8
- RUN apt-get update && apt-get install -y -q wget lsb-release apt-transport-https
5
+ ENV NGINX_PLUS_VERSION 1.13.7-2~stretch
9
6
10
7
# Download certificate and key from the customer portal (https://cs.nginx.com)
11
8
# and copy to the build context
12
- ADD nginx-repo.crt /etc/ssl/nginx/
13
- ADD nginx-repo.key /etc/ssl/nginx/
9
+ COPY nginx-repo.crt /etc/ssl/nginx/
10
+ COPY nginx-repo.key /etc/ssl/nginx/
14
11
15
12
# Make sure the certificate and key have correct permissions
16
13
RUN chmod 644 /etc/ssl/nginx/*
17
14
18
- # Get other files required for installation
19
- RUN wget -q -O - http://nginx.org/keys/nginx_signing.key | apt-key add -
20
- RUN wget -q -O /etc/apt/apt.conf.d/90nginx https://cs.nginx.com/static/files/90nginx
21
-
22
- RUN printf "deb https://plus-pkgs.nginx.com/ubuntu `lsb_release -cs` nginx-plus\n" >/etc/apt/sources.list.d/nginx-plus.list
23
-
24
15
# Install NGINX Plus
25
- RUN apt-get update && apt-get install -y nginx-plus
16
+ RUN set -x \
17
+ && apt-get update && apt-get upgrade -y \
18
+ && apt-get install --no-install-recommends --no-install-suggests -y apt-transport-https ca-certificates gnupg1 \
19
+ && \
20
+ NGINX_GPGKEY=573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62; \
21
+ found=''; \
22
+ for server in \
23
+ ha.pool.sks-keyservers.net \
24
+ hkp://keyserver.ubuntu.com:80 \
25
+ hkp://p80.pool.sks-keyservers.net:80 \
26
+ pgp.mit.edu \
27
+ ; do \
28
+ echo "Fetching GPG key $NGINX_GPGKEY from $server"; \
29
+ apt-key adv --keyserver "$server" --keyserver-options timeout=10 --recv-keys "$NGINX_GPGKEY" && found=yes && break; \
30
+ done; \
31
+ test -z "$found" && echo >&2 "error: failed to fetch GPG key $NGINX_GPGKEY" && exit 1; \
32
+ echo "Acquire::https::plus-pkgs.nginx.com::Verify-Peer \"true\";" >> /etc/apt/apt.conf.d/90nginx \
33
+ && echo "Acquire::https::plus-pkgs.nginx.com::Verify-Host \"true\";" >> /etc/apt/apt.conf.d/90nginx \
34
+ && echo "Acquire::https::plus-pkgs.nginx.com::SslCert \"/etc/ssl/nginx/nginx-repo.crt\";" >> /etc/apt/apt.conf.d/90nginx \
35
+ && echo "Acquire::https::plus-pkgs.nginx.com::SslKey \"/etc/ssl/nginx/nginx-repo.key\";" >> /etc/apt/apt.conf.d/90nginx \
36
+ && printf "deb https://plus-pkgs.nginx.com/debian stretch nginx-plus\n" > /etc/apt/sources.list.d/nginx-plus.list \
37
+ && apt-get update && apt-get install -y nginx-plus=${NGINX_PLUS_VERSION} \
38
+ && apt-get remove --purge --auto-remove -y gnupg1 \
39
+ && rm -rf /var/lib/apt/lists/* \
40
+ && rm -rf /etc/ssl/nginx \
41
+ && rm /etc/apt/apt.conf.d/90nginx /etc/apt/sources.list.d/nginx-plus.list
26
42
27
- EXPOSE 80 443 8080
28
43
29
44
# forward nginx access and error logs to stdout and stderr of the ingress
30
45
# controller process
31
46
RUN ln -sf /proc/1/fd/1 /var/log/nginx/access.log \
32
47
&& ln -sf /proc/1/fd/2 /var/log/nginx/error.log
33
48
49
+
50
+ EXPOSE 80 443
51
+
34
52
COPY nginx-ingress nginx/templates/nginx-plus.ingress.tmpl nginx/templates/nginx-plus.tmpl /
35
- RUN rm /etc/nginx/conf.d/*
36
53
37
- RUN mkdir -p /etc/nginx/secrets
54
+ RUN rm /etc/nginx/conf.d/* \
55
+ && mkdir -p /etc/nginx/secrets
38
56
39
57
# Uncomment the line below if you would like to add the default.pem to the image
40
58
# and use it as a certificate and key for the default server
41
59
# ADD default.pem /etc/nginx/secrets/default
42
60
43
- ENTRYPOINT ["/nginx-ingress"]
61
+ ENTRYPOINT ["/nginx-ingress"]
0 commit comments