Public Repository

Last pushed: 2 years ago
Short Description
Alpine docker image with installed 'nginx'.
Full Description

Supported tags

Project

This project is a Docker image project for nginx. The Docker image is based on docker-alpine v3.3 with installed nginx v1.8.0-r3.

Dockerfile description

This docker image based on a super small Docker Image docker-alpine v.3.3.

FROM alpine:3.3

Nginx server will be installed using Alpine Linux Package Management.

RUN apk add --update nginx=1.8.0-r3 && \

After Nginx installation, clean apk cache

rm -rf /var/cache/apk/* && \

Access and error log outputs should be forwarded to Docker log collector.

ln -sf /dev/stdout /var/log/nginx/access.log && \
ln -sf /dev/stderr /var/log/nginx/error.log

Copy default Nginx Server configuration into the Docker Image.

COPY nginx.conf /etc/nginx/nginx.conf

Exposing provided ports.

EXPOSE 80 443

Start Nginx Server on Docker run.

CMD nginx

Usage

First start of the image as daemon with default static content:

$ docker run -d -p 80:80 codizz/nginx

After starting the nginx server, try to access the default static content: http://localhost.
In the console, where you started the Docker container, you see the forwarded nginx server log outputs.

Use own server configuration:

$ docker run -d -p 80:80 -v ./my-nginx.conf:/etc/nginx/nginx.conf:ro codizz/nginx

Use own static content:

$ docker run -d -p 80:80 -v ./my-index.html:/usr/share/nginx/html/index.html:ro codizz/nginx

Get nginx version:

$ docker run codizz/nginx nginx -v

Get nginx help:

$ docker run codizz/nginx nginx -h

Switch to shell process in the running Docker container:

$ docker run -it codizz/nginx sh

License

MIT

Docker Pull Command
Owner
codizz

Comments (0)