add nginx container

Signed-off-by: Bin Yang <bin.yang@intel.com>
This commit is contained in:
Bin Yang
2019-03-27 07:38:35 -07:00
committed by William Douglas
parent 808494bbff
commit 53b38a5722
4 changed files with 59 additions and 0 deletions
+1
View File
@@ -12,6 +12,7 @@ env:
- DOCKERFILE_DIR=stacks/dlrs/oss
- DOCKERFILE_DIR=stacks/dlrs/mkl
- DOCKERFILE_DIR=postgres
- DOCKERFILE_DIR=nginx
script:
- cd $DOCKERFILE_DIR
+20
View File
@@ -0,0 +1,20 @@
FROM clearlinux:latest
MAINTAINER bin.yang@intel.com
RUN swupd update $swupd_args && \
swupd bundle-add nginx $swupd_args
RUN rm -rf /var/lib/swupd
# forward request and error logs to docker log collector
RUN mkdir -p /var/log/nginx
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log
RUN mkdir -p /var/lib/nginx/
RUN mkdir -p /etc/nginx/conf.d
RUN cp -f /usr/share/nginx/conf/nginx.conf.example /etc/nginx/nginx.conf
COPY default.conf /etc/nginx/conf.d/default.conf
VOLUME /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
+31
View File
@@ -0,0 +1,31 @@
nginx
==========
This provides a Clear Linux* nginx service
Build
-----
```
docker build -t clearlinux/nginx .
```
Or just pull it from Dockerhub
---------------------------
```
docker pull clearlinux/nginx
```
Start nginx Container
-----------------------
```
docker run -p 80:80 -v /var/www:/var/www -d clearlinux/nginx
```
How to use this image
---------------------
- See ``How to use this image`` section of the official nginx image [page](https://hub.docker.com/_/nginx).
Extra Build ARGs
----------------
- ``swupd_args`` Specifies [SWUPD](https://clearlinux.org/documentation/swupdate_how_to_run_the_updater.html) flags
Default build args in Docker are on: https://docs.docker.com/engine/reference/builder/#arg
+7
View File
@@ -0,0 +1,7 @@
server {
server_name localhost;
location / {
root /usr/share/nginx/html;
autoindex on;
}
}