Skip to content

Instantly share code, notes, and snippets.

@taion809
Last active December 21, 2015 13:49
Show Gist options
  • Save taion809/6315782 to your computer and use it in GitHub Desktop.
Save taion809/6315782 to your computer and use it in GitHub Desktop.
Dockerfile for building an nginx webserver from nginx.org's mainline repo
# nginx mainline from the nginx.org apt repository as of this gist 1.5.3
#
#
# Version 0.1
#
# Build instructions:
# sudo docker build -t="nginx" .
#
# Usage:
# sudo docker -d nginx
# or
# sudo docker -d -p 80:80 nginx
#
FROM ubuntu
MAINTAINER Nicholas Johns
#Try to combine RUN directives where possible to avoid hitting the RUN limit.
RUN apt-get update; apt-get install -y wget
RUN wget -qO - http://nginx.org/keys/nginx_signing.key | apt-key add -
RUN echo "deb http://nginx.org/packages/mainline/ubuntu/ precise nginx" > /etc/apt/sources.list.d/nginx.list; apt-get update
RUN apt-get install -y -q nginx
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
EXPOSE 80
CMD ["nginx"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment