Docker image use cases - sidaw/codalab-worksheets GitHub Wiki

Installing packages

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

Useful images on Docker Hub

References

⚠️ **GitHub.com Fallback** ⚠️