Public | Automated Build

Last pushed: 7 months ago
Short Description
Nginx web server Docker image, compiled from release source.
Full Description

Docker nginx

Dockerfile using Ubuntu 16.04 as base which provides:

  • nginx 1.12.2 (compiled from source).
  • Host file system served nginx config.
  • Logging within container at /var/log/nginx (optionally passed back to host).
  • Document root from host file system mounted within container at /srv/http.
  • Ports 80 (HTTP) and 443 (HTTPS) exposed to host at 8080 / 8443 respectively.


To build Docker image:

$ ./

Alternatively pull the image from Docker Hub:

$ docker pull magnetikonline/nginx

Then to run:

$ ./ \
    -c "/path/to/nginx.conf" \
    -d "/path/to/docroot"

To pass nginx logs back to host:

$ ./ \
    -c "/path/to/nginx.conf" \
    -d "/path/to/docroot" \
    -l "/path/to/logs"

An nginx configuration example located under resource/conf.

Docker Pull Command
Source Repository