-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
32 lines (26 loc) · 1.07 KB
/
Dockerfile
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
28
29
30
31
32
FROM alpine:3.16
ENV NGINX_VERSION=1.25.3
RUN sed -i "s/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g" /etc/apk/repositories \
&& apk add --no-cache --virtual .build_deps \
gcc \
make \
libc-dev \
curl \
&& curl -fsSL -O https://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz \
&& tar -zxvf nginx-${NGINX_VERSION}.tar.gz \
&& cd nginx-${NGINX_VERSION} \
&& ./configure --prefix=/opt/k8s/kube-nginx \
--with-stream --without-http \
--without-http_uwsgi_module \
--without-http_scgi_module --without-http_fastcgi_module \
&& make \
&& make install \
&& rm -rf nginx-${NGINX_VERSION}.tar.gz \
nginx-${NGINX_VERSION} \
&& apk del --no-network .build_deps \
&& ln -sf /dev/stdout /opt/k8s/kube-nginx/logs/access.log \
&& ln -sf /dev/stderr /opt/k8s/kube-nginx/logs/error.log
EXPOSE 18443
STOPSIGNAL SIGTERM
ENTRYPOINT ["/opt/k8s/kube-nginx/sbin/nginx","-c","/opt/k8s/kube-nginx/conf/kube-nginx.conf","-p","/opt/k8s/kube-nginx"]
CMD ["-g", "daemon off;"]