In case you don't have Docker setup, here's the set of commands that will bootstrap Docker for Ubuntu (Note: please use Ubuntu 13.04+).
sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -"
sudo sh -c "echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
apt-get update
apt-get upgrade -y
apt-get install -y lxc-docker
Lets imagine you downloaded the Dockerfile to the same directory you are currently in
# Build the Dockerfile and tag it as nbviewer
docker build -t nbviewer .
Now let's setup nbviewer so it is being served on port 80 on our host machine, running detached (no stdout).
# Bind nbviewer on port 8080 of the container to TCP port 80 on all available interfaces of the host machine.
# Run the container in detached mode (no stdout)
docker run -d -p 80:8080 nbviewer
If we want nbviewer to freely dump to stdout, we can turn off detached mode.
# Bind nbviewer on port 8080 of the container to TCP port 80 on all available interfaces of the host machine.
docker run -p 80:8080 nbviewer
The issue with this right now though is that the current shell can't be killed with a simple Ctrl-C (on the current Docker release).
To terminate the running instance in another terminal on the same box, show all the running containers
docker ps
then kill the container by its ID
docker kill <container_id>
Example termination
root@docking:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
b5c81195c9ce nbviewer:latest /bin/sh -c python -m 2 minutes ago Up 2 minutes 0.0.0.0:80->8080/tcp
root@docking:~# docker kill b5
b5
root@docking:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS