Public | Automated Build

Last pushed: 2 years ago
Short Description
Nginx v1.6.0 container image that uses volumes to control server configuration.
Full Description

Docker Nginx

Dockerfile to build Nginx v1.6.0 container image.

Table of Contents


The current release ( contains scripts to install Nginx v1.6.0, and uses the Brightcommerce Ubuntu 14.04 base image. Our version numbers will reflect the version of Nginx being installed.


Pull the latest version of the image from the Docker Index. This is the recommended method of installation as it is easier to update the image in the future. These builds are performed by the Docker Trusted Build service.

docker pull brightcommerce/nginx:latest

or specify a tagged version:

docker pull brightcommerce/nginx:

Alternately you can build the image yourself:

git clone
cd docker-nginx
docker build -t="$USER/nginx" .


This image uses volumes and environment variables to control the nginx server configuration.


  • /etc/nginx/sites-available: Site configurations
  • /usr/share/nginx/html: HTML for the default site, and
  • /etc/nginx/conf.d: Change sites configurations using it.
  • /var/log/nginx: Access log from here.

Pass with -v docker option. Don't forget to use absolute path here.


This installation exposes port 80.

How To Use

Shell Access

The following Docker run command above will start a container and give you a shell. Don't forget to start the service running the startup & script:

$ docker run -p 80:80 -i \
-v `pwd`/volumes/sites-available:/etc/nginx/sites-available \
-v `pwd`/volumes/html:/usr/share/nginx/html \
-v `pwd`/volumes/conf.d:/etc/nginx/conf.d \
-v `pwd`/volumes/log:/var/log/nginx \
-t brightcomemrce/nginx:latest /bin/bash

Daemonized Service

The following command above will start a container and return its' ID:

$ docker run --name nginx -p 80:80 -d \
-v `pwd`/volumes/sites-available:/etc/nginx/sites-available \
-v `pwd`/volumes/html:/usr/share/nginx/html \
-v `pwd`/volumes/conf.d:/etc/nginx/conf.d \
-v `pwd`/volumes/log:/var/log/nginx \
-t brightcommerce/nginx:latest


To upgrade to newer releases, simply follow this 3 step upgrade procedure.

  • Step 1: Stop the currently running image:
docker stop nginx
  • Step 2: Update the docker image:
docker pull brightcommerce/nginx:latest
  • Step 3: Start the image:
docker run --name nginx -d [OPTIONS] brightcommerce/nginx:latest


Copyright 2014 Brightcommerce, Inc.

Docker Pull Command
Source Repository