@@ -4,8 +4,7 @@ ARG JAEGER_VERSION=v0.4.2
4
4
RUN set -x \
5
5
&& apt-get update \
6
6
&& apt-get install --no-install-recommends --no-install-suggests -y ca-certificates apt-transport-https wget \
7
- && wget https://github.com/jaegertracing/jaeger-client-cpp/releases/download/${JAEGER_VERSION}/libjaegertracing_plugin.linux_amd64.so -O /usr/local/lib/libjaegertracing_plugin.so
8
-
7
+ && wget https://github.com/jaegertracing/jaeger-client-cpp/releases/download/${JAEGER_VERSION}/libjaegertracing_plugin.linux_amd64.so -O /usr/local/lib/libjaegertracing_plugin.so
9
8
10
9
# Final Image
11
10
FROM debian:stretch-slim
@@ -27,7 +26,7 @@ RUN chmod 644 /etc/ssl/nginx/*
27
26
# Install NGINX Plus
28
27
RUN set -x \
29
28
&& apt-get update \
30
- && apt-get install --no-install-recommends --no-install-suggests -y apt-transport-https ca-certificates gnupg1 \
29
+ && apt-get install --no-install-recommends --no-install-suggests -y apt-transport-https ca-certificates gnupg1 libcap2-bin \
31
30
&& \
32
31
NGINX_GPGKEY=573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62; \
33
32
found=''; \
@@ -51,6 +50,7 @@ RUN set -x \
51
50
nginx-plus=${NGINX_PLUS_VERSION} \
52
51
# Install OpenTracing module
53
52
nginx-plus-module-opentracing=${NGINX_OPENTRACING_MODULE_VERSION} \
53
+ && setcap 'cap_net_bind_service=+ep' /usr/sbin/nginx \
54
54
&& apt-get remove --purge --auto-remove -y gnupg1 \
55
55
&& rm -rf /var/lib/apt/lists/* \
56
56
&& rm -rf /etc/ssl/nginx \
@@ -63,19 +63,25 @@ RUN ln -sf /proc/1/fd/1 /var/log/nginx/access.log \
63
63
&& ln -sf /proc/1/fd/1 /var/log/nginx/stream-access.log \
64
64
&& ln -sf /proc/1/fd/2 /var/log/nginx/error.log
65
65
66
-
67
66
# Edit the line below to use a different tracer
68
67
COPY --from=tracer-downloader /usr/local/lib/libjaegertracing_plugin.so /usr/local/lib/libjaegertracing_plugin.so
69
68
69
+ RUN mkdir -p /var/lib/nginx \
70
+ && mkdir -p /etc/nginx/secrets \
71
+ && chown -R nginx:0 /etc/nginx \
72
+ && chown -R nginx:0 /var/cache/nginx \
73
+ && chown -R nginx:0 /var/lib/nginx/ \
74
+ && apt-get remove --purge -y libcap2-bin \
75
+ && rm /etc/nginx/conf.d/*
76
+
70
77
EXPOSE 80 443
71
78
72
79
COPY nginx-ingress internal/configs/version1/nginx-plus.ingress.tmpl internal/configs/version1/nginx-plus.tmpl internal/configs/version2/nginx-plus.virtualserver.tmpl /
73
80
74
- RUN rm /etc/nginx/conf.d/* \
75
- && mkdir -p /etc/nginx/secrets
76
-
77
81
# Uncomment the line below if you would like to add the default.pem to the image
78
82
# and use it as a certificate and key for the default server
79
83
# ADD default.pem /etc/nginx/secrets/default
80
84
81
- ENTRYPOINT ["/nginx-ingress"]
85
+ USER nginx
86
+
87
+ ENTRYPOINT ["/nginx-ingress"]
0 commit comments