Daniel Farrell
Software Engineer, Red Hat SDN Team
# Base the image on Debian 7
# Picked Debian because it's small (85MB)
# https://registry.hub.docker.com/_/debian/
FROM debian:7
# Install required software (170MB)
RUN apt-get update && apt-get install -y openjdk-7-jre-headless wget
WORKDIR /opt
EXPOSE 162 179 1088 1790 1830 2400 2550 2551 2552 4189 4342 5005 5666 6633 6640 6653 7800 8000 8080 8101 8181 8383 12001
# Drop source (bot2014, current context) in /opt dir
# Do the ADD as late as possible, as it invalidates cache
ADD . /opt/bot
CMD ["./bin/karaf", "server"]
[~/foss_rocks]$ time docker build -t dfarrell07/preanalytics:dev .
Sending build context to Docker daemon 343 kB
Step 0 : FROM debian:8.0
---> 835c4d274060
# Snip
Step 3 : ADD requirements.txt /tmp/requirements.txt
---> Using cache
---> 905a16f73f42
Step 4 : RUN pip install -r /tmp/requirements.txt
---> Using cache
---> f0af2258d85b
# Snip
Successfully built d3b3424b1313
docker build -t dfarrell07/preanalytics:dev . 0.01s user 0.01s system 7% cpu
Step 6 : WORKDIR /opt/preanalytics
---> Using cache
---> d3b3424b1313
Successfully built d3b3424b1313
docker build [-t tag name] .
docker build -t dfarrell07/opendaylight:dev .
[~]$ docker images | tail -n 5
debian 8.0 835c4d274060 5 weeks ago 122.6 MB
debian jessie 835c4d274060 5 weeks ago 122.6 MB
fedora 21 834629358fe2 5 weeks ago 250.2 MB
fedora latest 834629358fe2 5 weeks ago 250.2 MB
dfarrell07/helium dev e5ece2a3040a 7 weeks ago 537.3 MB
[~]$ docker run -ti dfarrell07/helium:dev bash
root@97aec28eae4d:/opt/opendaylight#
[~]$ docker run -ti dfarrell07/preanalytics:dev tox
# snip
Ran 160 tests in 26.513s
OK (skipped=4)
[~/preanalytics]$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
bb6450f64015 dfarrell07/preanalytics:dev "bash" 26 minutes ago Up 26 minutes condescending_bell
By Daniel Farrell
Talk given at the NCSU LUG's 2015 FOSS Fair