Here I explain how to run the iPython notebooks for Assignment #1 of the Stanford CS231n: Convolutional Neural Networks for Visual Recognition online course in a Docker container.

Docker lets you run software within isolated containers. A Docker container encapsulates a repeatable set of software that's completely separated from your main operating system install.

The iPython project on Github already has a Docker image with the latest version of iPython, Scipy and other numerical Python libraries. This image automatically starts an iPython notebook server and serves it on port 8888.

To get the CS231n Assignment running via Docker you must first download and extract the CS231n Assignment 1 starter kit into a directory. (On my system I've put them in /home/ganon/Downloads/CS231n .) Running the Assignment 1 notebook using Docker is then as simple as booting up an iPython container:

$ sudo docker run -it -p 80:8888 -e "USE_HTTP=1" -e "PASSWORD=" -v /home/ganon/Downloads/CS231n:/CS231n ipython/scipyserver

-it runs the container in interactive mode so that we can easily see any errors, or kill the container when we're finished;

runs the container in interactive mode so that we can easily see any errors, or kill the container when we're finished; -p 80:8888 The python/scipyserver image runs a notebook server on port 8888 in its container. We want to be able to access the notebook server externally, so we bind port 8888 of the container to port 80 on our local machine. This lets us access the notebook server by visiting http://localhost/ from our browser;

The python/scipyserver image runs a notebook server on port 8888 in its container. We want to be able to access the notebook server externally, so we bind port 8888 of the container to port 80 on our local machine. This lets us access the notebook server by visiting http://localhost/ from our browser; -e "USE_HTTP=1" forces the notebook server to serve HTTP rather than HTTPS. We're accessing this server locally so a secure connection is overkill;

forces the notebook server to serve HTTP rather than HTTPS. We're accessing this server locally so a secure connection is overkill; -e "PASSWORD=" again, beacuse we're accessing the notebook server locally we won't need a password;

again, beacuse we're accessing the notebook server locally we won't need a password; -v /home/ganon/Downloads/CS231n:/CS231n mounts the drive on our local machine within the new container. This let's us open and execute the assignment notebooks;

mounts the drive on our local machine within the new container. This let's us open and execute the assignment notebooks; python/scipyserver is the docker image we want to run. This image has an Ubuntu base with all the necessary Python packages for the assignment.

After running this command Docker will download a few GB of files, primarily the base Ubuntu image and the scipy installation. Once downloaded you will see a log message The IPython Notebook is running :