Update nginx from 1.14 to 1.17

Signed-off-by: Qi Zheng <qi.zheng@intel.com>
This commit is contained in:
Qi Zheng
2019-08-08 20:39:54 +00:00
committed by qzheng527
parent 9a4999969d
commit d7b52070b2
3 changed files with 29 additions and 13 deletions
+23 -10
View File
@@ -1,5 +1,6 @@
FROM clearlinux:latest AS builder
ARG swupd_args
# Move to latest Clear Linux release to ensure
# that the swupd command line arguments are
# correct
@@ -15,7 +16,7 @@ RUN source /os-release && \
mkdir /install_root \
&& swupd os-install -V ${VERSION_ID} \
--path /install_root --statedir /swupd-state \
--bundles=nginx --no-boot-update
--bundles=nginx-mainline --no-boot-update
# For some Host OS configuration with redirect_dir on,
# extra data are saved on the upper layer when the same
@@ -27,19 +28,31 @@ RUN cd / && \
find os_core_install | sed -e 's/os_core_install/install_root/' | xargs rm -d &> /dev/null || true
FROM clearlinux/os-core:latest
MAINTAINER bin.yang@intel.com
MAINTAINER qi.zheng@intel.com
COPY --from=builder /install_root /
COPY default.conf /etc/nginx/conf.d/default.conf
COPY default.conf /etc/nginx-mainline/conf.d/default.conf
RUN mkdir -p /var/log/nginx && \
# create directories for nginx-mainline
RUN mkdir -p /var/www/html && \
mkdir -p /etc/nginx-mainline && \
mkdir -p /var/log/nginx-mainline && \
mkdir -p /var/lib/nginx-mainline/uwsgi && \
mkdir -p /var/lib/nginx-mainline/client-body && \
mkdir -p /var/lib/nginx-mainline/proxy && \
mkdir -p /var/lib/nginx-mainline/fast-cgi && \
# add links to make it compatible with general name nginx
ln -sf /var/log/nginx-mainline /var/log/nginx && \
ln -sf /var/lib/nginx-mainline /var/lib/nginx && \
ln -sf /etc/nginx-mainline /etc/nginx && \
ln -sf /usr/bin/nginx-mainline /usr/bin/nginx && \
# forward request and error logs to docker log collector
ln -sf /dev/stdout /var/log/nginx/access.log && \
ln -sf /dev/stderr /var/log/nginx/error.log && \
mkdir -p /var/lib/nginx/ && \
cp -f /usr/share/nginx/conf/nginx.conf.example /etc/nginx/nginx.conf
ln -sf /dev/stdout /var/log/nginx-mainline/access.log && \
ln -sf /dev/stderr /var/log/nginx-mainline/error.log && \
cp -f /usr/share/nginx-mainline/conf/nginx.conf.example /etc/nginx-mainline/nginx.conf && \
cp -f /usr/share/nginx-mainline/html/* /var/www/html/
VOLUME /usr/share/nginx/html
EXPOSE 80
STOPSIGNAL SIGTERM
CMD ["nginx", "-g", "daemon off;"]
+4 -1
View File
@@ -16,8 +16,11 @@ docker pull clearlinux/nginx
Start nginx Container
-----------------------
The default root path is /var/www/html.
The default configuration path is /etc/nginx/.
```
docker run -p 80:80 -v /some/content:/usr/share/nginx/html -d clearlinux/nginx
docker run -p 80:80 -v /some/content:/var/www/html -d clearlinux/nginx
```
How to use this image
+2 -2
View File
@@ -1,8 +1,8 @@
server {
server_name localhost;
location / {
root /usr/share/nginx/html;
root /var/www/html;
autoindex on;
access_log /var/log/nginx/access.log combined;
access_log /var/log/nginx-mainline/access.log combined;
}
}