Docker image use cases - sidaw/codalab-worksheets GitHub Wiki
Given a working internet connection, it is straightforward to use package managers by running commands in the Dockerfile. We use pip as an example:
RUN pip install --upgrade numpy
When dependencies are specified in a pip requirements file requirements.txt
, we can add it to docker with the command ADD <src>... <dest>
. Assuming that requirements.txt
is in the same directory as the following Dockerfile, we can run
docker build -t humblepeople/pipinstall:1.0 .
to install everything specified in requirements.txt
:
FROM ubuntu:14.04
MAINTAINER humble person
RUN apt-get -y update
RUN apt-get -y install python-pip python-dev build-essential
ADD ./requirements.txt /user/requirements.txt
RUN pip install -r /user/requirements.txt
-
ubuntu:14.04: less than 200MB, which is a good place to start
-
codalab/ubuntu:1.9: Java 1.8, Python 2.7, Anaconda 2.1 etc. are installed. But it is around 5GB
-
tensorflow: the official tensorflow image
-
ipython notebook: Docker image to run IPython notebook.