SlideShare a Scribd company logo
1 of 218
Download to read offline
ICWE 2016, Lugano
Photo Credits: Astrid Westvang, https://flic.kr/p/pWJLCW
Using Docker Containers to Improve Reproducibility
in Software and Web Engineering
Jürgen Cito, Vincenzo Ferme, Harald C. Gall
2
Jürgen Cito
PhD @ UZH
Vincenzo Ferme
PhD @ USI
The speakers
3
This tutorial…
Conceptual,
more abstract
notion of
Reproducibility
Concrete
instructions
to aid
Reproducibility in
Research & Industry
4
Agenda
Part I:

What is Reproducibility?

A theoretical perspective
4
Agenda
Part I:

What is Reproducibility?

A theoretical perspective
Part II:

Docker to Aid Reproducibility

Basics and Case Study 1 (Research Project Case Study)

4
Agenda
Part I:

What is Reproducibility?

A theoretical perspective
Part II:

Docker to Aid Reproducibility

Basics and Case Study 1 (Research Project Case Study)

Part III:

Docker to Aid Reproducibility

Advanced Topics and Case Study 2 (Industrial Case Study)

Photo Credits: Astrid Westvang, https://flic.kr/p/pWJLCW
Part I - What is Reproducibility?
Jürgen Cito, Vincenzo Ferme, Harald C. Gall
ICWE 2016, Lugano
6
Reproducibility is the ability of an entire experiment or
study to be duplicated, either by the same researcher
or by someone else working independently.
Reproducing an experiment is called replicating it.
What is Reproducibility?
No research paper can ever be considered

to be the final word, and the replication
and corroboration of research results is key
to the scientific process.
7
What is Reproducibility?
Repeatability of a certain process in order to establish a fact or
the conditions under which we are able to observe the same fact*
A process to share methods, and describe the environment, 

in order to recreate results.
* Mockus et al. “Experiences from replicating a case study to investigate reproducibility of software development.”
8
Scientific Process
Experiment Design
Data Collection
Data Analysis
Results Interpretation
Hypotheses
Reproducibility
9
What is Reproducibility?
Establishing facts

> Steps (or a method) to establish the fact

> Sharing computational knowledge
9
What is Reproducibility?
Establishing facts

> Steps (or a method) to establish the fact

> Sharing computational knowledge
Controlling environment

> Execution environment

> Dependencies
9
What is Reproducibility?
Establishing facts

> Steps (or a method) to establish the fact

> Sharing computational knowledge
Controlling environment

> Execution environment

> Dependencies
Providing data

> Ability to interpret data

> Computational analyses
9
What is Reproducibility?
Establishing facts

> Steps (or a method) to establish the fact

> Sharing computational knowledge
Controlling environment

> Execution environment

> Dependencies
Providing data

> Ability to interpret data

> Computational analyses
Low barriers to replicate

> Comprehensible results

> Ease of achieving replication
10
What is Reproducibility in SE/WE Research?
Algorithms / Computational Analyses
Developed Tools or Prototypes
Quantitative Evaluations
+ internal knowledge of the necessary process to
derive/establish results

11
In Software Engineering Research:

- FSE’15/16, MSR’15/16
In Programming Languages Research:

- PLDI, POPL, OOPSLA
Artifact Evaluation & Replication Packages
12
Current State of Sharing Artefacts
Researcher’s website
Photo Credits: Astrid Westvang, https://flic.kr/p/pWJLCW
Part II - Research Project Case Study
Jürgen Cito, Vincenzo Ferme, Harald C. Gall
ICWE 2016, Lugano
14
Case Study 1: ChangeDistiller
https://bitbucket.org/sealuzh/tools-changedistiller
Research Project
15
Why is reproducibility hard?
Why does it fail?
16
Reasons for Failed Reproducibility (1/2)
*https://twitter.com/ianholmes/status/288689712636493824
17Source: Collberg et al., “Measuring Reproducibility in Computer Systems Research”, http://reproducibility.cs.arizona.edu/tr.pdf
Reasons for Failed Reproducibility (2/2)
18
Case Study 1: ChangeDistiller
https://bitbucket.org/sealuzh/tools-changedistiller
Research Project
- Developed 2006-2009

How many Java versions have we passed?

- Dependencies defined in a Maven pom file

Are they all still available in the repository?

- How does analysis in ChangeDistiller work?

What is the entry point?
19
Challenges in Reproducibility
19
> No standard way of describing experiments,
environments, (derived) data, and workflows
Challenges in Reproducibility
19
> No standard way of describing experiments,
environments, (derived) data, and workflows
> No transparency in creating environments and the steps/
methods to establish facts or recreate analysis
Challenges in Reproducibility
19
> No standard way of describing experiments,
environments, (derived) data, and workflows
> No transparency in creating environments and the steps/
methods to establish facts or recreate analysis
> The experimental nature of the research code and
ecosystems makes it often hard to build
Challenges in Reproducibility
19
> No standard way of describing experiments,
environments, (derived) data, and workflows
> No transparency in creating environments and the steps/
methods to establish facts or recreate analysis
> The experimental nature of the research code and
ecosystems makes it often hard to build
> Unresolved or undocumented dependencies
Challenges in Reproducibility
19
> No standard way of describing experiments,
environments, (derived) data, and workflows
> No transparency in creating environments and the steps/
methods to establish facts or recreate analysis
> The experimental nature of the research code and
ecosystems makes it often hard to build
> Unresolved or undocumented dependencies
> Infrastructure for storage and distribution
Challenges in Reproducibility
20
… to the rescue
21
Docker Containers to the rescue (1/2)
What is Docker?
Docker allows you to package an application with all of its
dependencies into a standardized unit for software development*
Containers consist of everything that enables software to run:

> Code

> Runtime

> System Tools

> System Libraries
* https://www.docker.com/what-docker
22
Docker Containers to the rescue (2/2)
What can Docker be for SE/WE research?
Docker allows you to package a 

- Prototype

- Proof-of-concept Implementation

- Computational analysis or experiment 

with all of its dependencies into a standardized unit for
reproducible research
* https://www.docker.com/what-docker
Technical Overview / Virtual Machines vs Containers
“Lightweight” VM

> Container is an isolated process 

(“chroot on steroids”)

> Own process space

> Own network interface

> Feels like a VM

> Shares kernel with the host

> Isolation through cgroups/namespaces
23
https://www.docker.com/what-is-docker
https://blog.docker.com/2016/03/containers-are-not-vms/
24
Docker Engine
Centralized runtime environment for containers
Enables portability
Sole dependency for Docker
No Emulation layer (almost no performance impact)
https://www.docker.com/products/docker-engine
25
Benefits of Docker Containers
(compared to VMs)
Fast instantiation (~1-3 seconds)

Almost native performance

Transparent build process

Smaller Images

Easy to build, share, and publish
* https://www.docker.com/what-docker
25
Benefits of Docker Containers
(compared to VMs)
Fast instantiation (~1-3 seconds)

Almost native performance

Transparent build process

Smaller Images

Easy to build, share, and publish
* https://www.docker.com/what-docker
also compared to

other container technologies
26
Single Container Docker Workflow
# Build redis from source
# Make sure you have the redis source code
checked out in
# the same directory as this Dockerfile
FROM ubuntu:12.04
MAINTAINER dockerfiles http://
dockerfiles.github.io
RUN echo "deb http://archive.ubuntu.com/
ubuntu precise main universe" > /etc/apt/
sources.list
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y gcc make g++ build-
essential libc6-dev tcl wget
RUN wget http://download.redis.io/redis-
stable.tar.gz -O - | tar -xvz
# RUN tar -zvzf /redis/redis-stable.tar.gz
RUN (cd /redis-stable && make)
RUN (cd /redis-stable && make test)
RUN mkdir -p /redis-data
VOLUME ["/redis-data"]
EXPOSE 6379
ENTRYPOINT ["/redis-stable/src/redis-
server"]
CMD ["--dir", "/redis-data"]
Dockerfile
build
Image
Docker Image Docker Container
run
27
Dockerfile

Declarative definition of an environment for producing an image



Docker Image

Immutable artifact built from a Dockerfile, has one to many layers
Docker Container

Execution environment - Instantiation/running version of an image (can be
parameterized)
Docker Machine

Creates Docker hosts on your local Mac or Windows box
Docker Registry

Public or private repository stores images and allows for their distribution

(Docker Hub - https://hub.docker.com/ or CoreOS Quay - https://quay.io/)
Terminology
build
28
Single Container Docker Workflow
# Build redis from source
# Make sure you have the redis source code
checked out in
# the same directory as this Dockerfile
FROM ubuntu:12.04
MAINTAINER dockerfiles http://
dockerfiles.github.io
RUN echo "deb http://archive.ubuntu.com/
ubuntu precise main universe" > /etc/apt/
sources.list
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y gcc make g++ build-
essential libc6-dev tcl wget
RUN wget http://download.redis.io/redis-
stable.tar.gz -O - | tar -xvz
# RUN tar -zvzf /redis/redis-stable.tar.gz
RUN (cd /redis-stable && make)
RUN (cd /redis-stable && make test)
RUN mkdir -p /redis-data
VOLUME ["/redis-data"]
EXPOSE 6379
ENTRYPOINT ["/redis-stable/src/redis-
server"]
CMD ["--dir", "/redis-data"]
Dockerfile
Image
Docker Image Docker Container
run
29
Dockerfile
Defines the infrastructure and dependencies of a container through instructions
# Build redis from source
# Make sure you have the redis source code checked out in
# the same directory as this Dockerfile
FROM ubuntu:12.04
MAINTAINER dockerfiles
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/
sources.list
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y gcc make g++ build-essential libc6-dev tcl wget
RUN wget http://download.redis.io/redis-stable.tar.gz -O - | tar -xvz
# RUN tar -zvzf /redis/redis-stable.tar.gz
RUN (cd /redis-stable && make)
RUN (cd /redis-stable && make test)
COPY redis.conf /var/www/redis.conf
RUN mkdir -p /redis-data
VOLUME ["/redis-data"]
EXPOSE 6379
ENTRYPOINT ["/redis-stable/src/redis-server"]
CMD ["--dir", "/redis-data"]
29
Dockerfile
Defines the infrastructure and dependencies of a container through instructions
# Build redis from source
# Make sure you have the redis source code checked out in
# the same directory as this Dockerfile
FROM ubuntu:12.04
MAINTAINER dockerfiles
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/
sources.list
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y gcc make g++ build-essential libc6-dev tcl wget
RUN wget http://download.redis.io/redis-stable.tar.gz -O - | tar -xvz
# RUN tar -zvzf /redis/redis-stable.tar.gz
RUN (cd /redis-stable && make)
RUN (cd /redis-stable && make test)
COPY redis.conf /var/www/redis.conf
RUN mkdir -p /redis-data
VOLUME ["/redis-data"]
EXPOSE 6379
ENTRYPOINT ["/redis-stable/src/redis-server"]
CMD ["--dir", "/redis-data"]
Base Image
29
Dockerfile
Defines the infrastructure and dependencies of a container through instructions
# Build redis from source
# Make sure you have the redis source code checked out in
# the same directory as this Dockerfile
FROM ubuntu:12.04
MAINTAINER dockerfiles
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/
sources.list
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y gcc make g++ build-essential libc6-dev tcl wget
RUN wget http://download.redis.io/redis-stable.tar.gz -O - | tar -xvz
# RUN tar -zvzf /redis/redis-stable.tar.gz
RUN (cd /redis-stable && make)
RUN (cd /redis-stable && make test)
COPY redis.conf /var/www/redis.conf
RUN mkdir -p /redis-data
VOLUME ["/redis-data"]
EXPOSE 6379
ENTRYPOINT ["/redis-stable/src/redis-server"]
CMD ["--dir", "/redis-data"]
Base Image
Base Image can be an OS (Ubuntu)
or a different, existing image
29
Dockerfile
Defines the infrastructure and dependencies of a container through instructions
# Build redis from source
# Make sure you have the redis source code checked out in
# the same directory as this Dockerfile
FROM ubuntu:12.04
MAINTAINER dockerfiles
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/
sources.list
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y gcc make g++ build-essential libc6-dev tcl wget
RUN wget http://download.redis.io/redis-stable.tar.gz -O - | tar -xvz
# RUN tar -zvzf /redis/redis-stable.tar.gz
RUN (cd /redis-stable && make)
RUN (cd /redis-stable && make test)
COPY redis.conf /var/www/redis.conf
RUN mkdir -p /redis-data
VOLUME ["/redis-data"]
EXPOSE 6379
ENTRYPOINT ["/redis-stable/src/redis-server"]
CMD ["--dir", "/redis-data"]
Dependencies
Base Image
Base Image can be an OS (Ubuntu)
or a different, existing image
29
Dockerfile
Defines the infrastructure and dependencies of a container through instructions
# Build redis from source
# Make sure you have the redis source code checked out in
# the same directory as this Dockerfile
FROM ubuntu:12.04
MAINTAINER dockerfiles
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/
sources.list
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y gcc make g++ build-essential libc6-dev tcl wget
RUN wget http://download.redis.io/redis-stable.tar.gz -O - | tar -xvz
# RUN tar -zvzf /redis/redis-stable.tar.gz
RUN (cd /redis-stable && make)
RUN (cd /redis-stable && make test)
COPY redis.conf /var/www/redis.conf
RUN mkdir -p /redis-data
VOLUME ["/redis-data"]
EXPOSE 6379
ENTRYPOINT ["/redis-stable/src/redis-server"]
CMD ["--dir", "/redis-data"]
Dependencies
Base Image
Base Image can be an OS (Ubuntu)
or a different, existing image
Runs commands as if you were typing
them in the command line
29
Dockerfile
Defines the infrastructure and dependencies of a container through instructions
# Build redis from source
# Make sure you have the redis source code checked out in
# the same directory as this Dockerfile
FROM ubuntu:12.04
MAINTAINER dockerfiles
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/
sources.list
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y gcc make g++ build-essential libc6-dev tcl wget
RUN wget http://download.redis.io/redis-stable.tar.gz -O - | tar -xvz
# RUN tar -zvzf /redis/redis-stable.tar.gz
RUN (cd /redis-stable && make)
RUN (cd /redis-stable && make test)
COPY redis.conf /var/www/redis.conf
RUN mkdir -p /redis-data
VOLUME ["/redis-data"]
EXPOSE 6379
ENTRYPOINT ["/redis-stable/src/redis-server"]
CMD ["--dir", "/redis-data"]
Dependencies
Base Image
Install
Base Image can be an OS (Ubuntu)
or a different, existing image
Runs commands as if you were typing
them in the command line
29
Dockerfile
Defines the infrastructure and dependencies of a container through instructions
# Build redis from source
# Make sure you have the redis source code checked out in
# the same directory as this Dockerfile
FROM ubuntu:12.04
MAINTAINER dockerfiles
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/
sources.list
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y gcc make g++ build-essential libc6-dev tcl wget
RUN wget http://download.redis.io/redis-stable.tar.gz -O - | tar -xvz
# RUN tar -zvzf /redis/redis-stable.tar.gz
RUN (cd /redis-stable && make)
RUN (cd /redis-stable && make test)
COPY redis.conf /var/www/redis.conf
RUN mkdir -p /redis-data
VOLUME ["/redis-data"]
EXPOSE 6379
ENTRYPOINT ["/redis-stable/src/redis-server"]
CMD ["--dir", "/redis-data"]
Dependencies
Base Image
Install
Base Image can be an OS (Ubuntu)
or a different, existing image
Runs commands as if you were typing
them in the command line
Copies local files from
build context into container
29
Dockerfile
Defines the infrastructure and dependencies of a container through instructions
# Build redis from source
# Make sure you have the redis source code checked out in
# the same directory as this Dockerfile
FROM ubuntu:12.04
MAINTAINER dockerfiles
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/
sources.list
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y gcc make g++ build-essential libc6-dev tcl wget
RUN wget http://download.redis.io/redis-stable.tar.gz -O - | tar -xvz
# RUN tar -zvzf /redis/redis-stable.tar.gz
RUN (cd /redis-stable && make)
RUN (cd /redis-stable && make test)
COPY redis.conf /var/www/redis.conf
RUN mkdir -p /redis-data
VOLUME ["/redis-data"]
EXPOSE 6379
ENTRYPOINT ["/redis-stable/src/redis-server"]
CMD ["--dir", "/redis-data"]
Dependencies
Base Image
Install
Volume
Base Image can be an OS (Ubuntu)
or a different, existing image
Runs commands as if you were typing
them in the command line
Copies local files from
build context into container
29
Dockerfile
Defines the infrastructure and dependencies of a container through instructions
# Build redis from source
# Make sure you have the redis source code checked out in
# the same directory as this Dockerfile
FROM ubuntu:12.04
MAINTAINER dockerfiles
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/
sources.list
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y gcc make g++ build-essential libc6-dev tcl wget
RUN wget http://download.redis.io/redis-stable.tar.gz -O - | tar -xvz
# RUN tar -zvzf /redis/redis-stable.tar.gz
RUN (cd /redis-stable && make)
RUN (cd /redis-stable && make test)
COPY redis.conf /var/www/redis.conf
RUN mkdir -p /redis-data
VOLUME ["/redis-data"]
EXPOSE 6379
ENTRYPOINT ["/redis-stable/src/redis-server"]
CMD ["--dir", "/redis-data"]
Dependencies
Base Image
Install
Open Port
Volume
Base Image can be an OS (Ubuntu)
or a different, existing image
Runs commands as if you were typing
them in the command line
Copies local files from
build context into container
29
Dockerfile
Defines the infrastructure and dependencies of a container through instructions
# Build redis from source
# Make sure you have the redis source code checked out in
# the same directory as this Dockerfile
FROM ubuntu:12.04
MAINTAINER dockerfiles
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/
sources.list
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y gcc make g++ build-essential libc6-dev tcl wget
RUN wget http://download.redis.io/redis-stable.tar.gz -O - | tar -xvz
# RUN tar -zvzf /redis/redis-stable.tar.gz
RUN (cd /redis-stable && make)
RUN (cd /redis-stable && make test)
COPY redis.conf /var/www/redis.conf
RUN mkdir -p /redis-data
VOLUME ["/redis-data"]
EXPOSE 6379
ENTRYPOINT ["/redis-stable/src/redis-server"]
CMD ["--dir", "/redis-data"]
Dependencies
Base Image
Install
Open Port
Start Server
Volume
Base Image can be an OS (Ubuntu)
or a different, existing image
Runs commands as if you were typing
them in the command line
Copies local files from
build context into container
30
Data Volumes
A specially-designated directory within one or more
containers that bypasses the Union File System*



Volumes allow you to manage data within containers

> Mount a host directory (dependency to the host filesystem)

> Mount a data volume container (dependency to another container)

> Mount a shared-storage volume (NFS, iSCSI, etc.)
* https://docs.docker.com/engine/userguide/containers/dockervolumes/
31
Single Container Docker Workflow
# Build redis from source
# Make sure you have the redis source code
checked out in
# the same directory as this Dockerfile
FROM ubuntu:12.04
MAINTAINER dockerfiles http://
dockerfiles.github.io
RUN echo "deb http://archive.ubuntu.com/
ubuntu precise main universe" > /etc/apt/
sources.list
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y gcc make g++ build-
essential libc6-dev tcl wget
RUN wget http://download.redis.io/redis-
stable.tar.gz -O - | tar -xvz
# RUN tar -zvzf /redis/redis-stable.tar.gz
RUN (cd /redis-stable && make)
RUN (cd /redis-stable && make test)
RUN mkdir -p /redis-data
VOLUME ["/redis-data"]
EXPOSE 6379
ENTRYPOINT ["/redis-stable/src/redis-
server"]
CMD ["--dir", "/redis-data"]
Dockerfile
build
Image
Docker Image Docker Container
run
32
Dockerfile —> Image
Defines the infrastructure and dependencies of a container through instructions
docker build -t <imagename> .
32
Dockerfile —> Image
Defines the infrastructure and dependencies of a container through instructions
docker build -t <imagename> .
Build Context
containing all local
dependencies and
Dockerfile
33
Docker Images
# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
mhart/alpine-node latest 2a15d8568f75 1 week ago 36.76 MB
hakyll latest d575da1e730c 2 weeks ago 1.487 GB
redis alpine 50405530a7e5 4 weeks ago 15.95 MB
# docker rmi hakyll
Untagged: hakyll:latest
Deleted: sha256:3240943c9ea3f72db51…
Deleted: sha256:a3aeefae0d4b8f61…
Deleted: sha256:16a7ebd378002f1261…
33
Docker Images
# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
mhart/alpine-node latest 2a15d8568f75 1 week ago 36.76 MB
hakyll latest d575da1e730c 2 weeks ago 1.487 GB
redis alpine 50405530a7e5 4 weeks ago 15.95 MB
# docker rmi hakyll
Untagged: hakyll:latest
Deleted: sha256:3240943c9ea3f72db51…
Deleted: sha256:a3aeefae0d4b8f61…
Deleted: sha256:16a7ebd378002f1261…
Lists all previously built images
33
Docker Images
# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
mhart/alpine-node latest 2a15d8568f75 1 week ago 36.76 MB
hakyll latest d575da1e730c 2 weeks ago 1.487 GB
redis alpine 50405530a7e5 4 weeks ago 15.95 MB
# docker rmi hakyll
Untagged: hakyll:latest
Deleted: sha256:3240943c9ea3f72db51…
Deleted: sha256:a3aeefae0d4b8f61…
Deleted: sha256:16a7ebd378002f1261…
Lists all previously built images
Removes an image
‘hakyll:latest’
and all its layers
from the disk
34
Single Container Docker Workflow
# Build redis from source
# Make sure you have the redis source code
checked out in
# the same directory as this Dockerfile
FROM ubuntu:12.04
MAINTAINER dockerfiles http://
dockerfiles.github.io
RUN echo "deb http://archive.ubuntu.com/
ubuntu precise main universe" > /etc/apt/
sources.list
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y gcc make g++ build-
essential libc6-dev tcl wget
RUN wget http://download.redis.io/redis-
stable.tar.gz -O - | tar -xvz
# RUN tar -zvzf /redis/redis-stable.tar.gz
RUN (cd /redis-stable && make)
RUN (cd /redis-stable && make test)
RUN mkdir -p /redis-data
VOLUME ["/redis-data"]
EXPOSE 6379
ENTRYPOINT ["/redis-stable/src/redis-
server"]
CMD ["--dir", "/redis-data"]
Dockerfile
build
Image
Docker Image
run
Docker Container
35
Image —> Container
docker run -d --name <containername> -p 80:5000 <imagename>
https://docs.docker.com/engine/reference/run/
Many more possibilities to run containers, see full reference here:
(A typical example)
35
Image —> Container
docker run -d --name <containername> -p 80:5000 <imagename>
Run container
in the background

(d for daemon)
https://docs.docker.com/engine/reference/run/
Many more possibilities to run containers, see full reference here:
(A typical example)
35
Image —> Container
docker run -d --name <containername> -p 80:5000 <imagename>
Run container
in the background

(d for daemon)
https://docs.docker.com/engine/reference/run/
Give the container
a unique name
Many more possibilities to run containers, see full reference here:
(A typical example)
35
Image —> Container
docker run -d --name <containername> -p 80:5000 <imagename>
Run container
in the background

(d for daemon)
https://docs.docker.com/engine/reference/run/
Give the container
a unique name
Port mapping

First the exposed port (80)
Second the port within the container (5000)
Many more possibilities to run containers, see full reference here:
(A typical example)
36
Container Management
docker ps
docker ps -a
docker stop <container>
docker rm <container>
docker rm -v <container>
36
Container Management
docker ps
Lists all running containers
docker ps -a
docker stop <container>
docker rm <container>
docker rm -v <container>
36
Container Management
docker ps
Lists all running containers
docker ps -a
Lists all containers (including the ones that are stopped)
docker stop <container>
docker rm <container>
docker rm -v <container>
36
Container Management
docker ps
Lists all running containers
docker ps -a
Lists all containers (including the ones that are stopped)
docker stop <container>
Stops a running container
docker rm <container>
docker rm -v <container>
36
Container Management
docker ps
Lists all running containers
docker ps -a
Lists all containers (including the ones that are stopped)
docker stop <container>
Stops a running container
docker rm <container>
Removes a stopped container
docker rm -v <container>
36
Container Management
docker ps
Lists all running containers
docker ps -a
Lists all containers (including the ones that are stopped)
docker stop <container>
Stops a running container
docker rm <container>
Removes a stopped container
docker rm -v <container>
Removes a stopped container and its volumes
37
Container Debugging
docker run -ti --entrypoint=bash <imagename>
docker exec -ti <container> bash
docker inspect <container>
docker logs <container>
37
Container Debugging
docker run -ti --entrypoint=bash <imagename>
docker exec -ti <container> bash
docker inspect <container>
Low-level information on a container or image
docker logs <container>
37
Container Debugging
docker run -ti --entrypoint=bash <imagename>
docker exec -ti <container> bash
docker inspect <container>
Low-level information on a container or image
docker logs <container>
Retrieves logs printed to stdout/err within the container
37
Container Debugging
docker run -ti --entrypoint=bash <imagename>
docker exec -ti <container> bash
Starts an interactive shell into a running container
docker inspect <container>
Low-level information on a container or image
docker logs <container>
Retrieves logs printed to stdout/err within the container
37
Container Debugging
docker run -ti --entrypoint=bash <imagename>
Starts a container with a different entrypoint
docker exec -ti <container> bash
Starts an interactive shell into a running container
docker inspect <container>
Low-level information on a container or image
docker logs <container>
Retrieves logs printed to stdout/err within the container
38
Docker Hub: Public Registry
39
Pulling Docker Images

Getting started with existing images
docker pull nginx:latest
40
Pulling Docker Images

Getting started with existing images
docker pull nginx:latest
Reference to a Docker Image
in the Docker Hub
41
Pulling Docker Images

Getting started with existing images
docker pull nginx:latest
Images can have
many “tags”
42
Pulling Docker Images

Getting started with existing images
docker pull nginx:latest
Pulls an image from a Docker registry
43
Pushing Docker Images to a Registry

Tag Image
docker tag c6fdd6639541 <username>/<imagename>:<tagname>
Image Id 

(retrieve through )docker images
44
Pushing Docker Images to a Registry

Push Image
44
Pushing Docker Images to a Registry

Push Image
docker login --username=<username> --email=<email>
44
Pushing Docker Images to a Registry

Push Image
docker login --username=<username> --email=<email>
docker push <username>/<imagename>:<tagname>
45
Case Study 1: ChangeDistiller
https://bitbucket.org/sealuzh/tools-changedistiller
Research Project
# Build redis from source
# Make sure you have the redis source code
checked out in
# the same directory as this Dockerfile
FROM ubuntu:12.04
MAINTAINER dockerfiles http://
dockerfiles.github.io
RUN echo "deb http://archive.ubuntu.com/
ubuntu precise main universe" > /etc/apt/
sources.list
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y gcc make g++ build-
essential libc6-dev tcl wget
RUN wget http://download.redis.io/redis-
stable.tar.gz -O - | tar -xvz
# RUN tar -zvzf /redis/redis-stable.tar.gz
RUN (cd /redis-stable && make)
RUN (cd /redis-stable && make test)
RUN mkdir -p /redis-data
VOLUME ["/redis-data"]
EXPOSE 6379
ENTRYPOINT ["/redis-stable/src/redis-
server"]
CMD ["--dir", "/redis-data"]
Dockerfile
build
Image
Docker Image Docker Container
run
46
Prerequisites for attending the tutorial
Prerequisites
• git on your terminal
• OSX or Windows: Docker Toolbox, https://www.docker.com/products/
docker-toolbox. Then follow the getting started guide on the same page.
• Linux: 1) https://docs.docker.com/linux/, 2) https://docs.docker.com/
machine/install-machine/, 3) https://docs.docker.com/compose/install/
Git clone
• git clone https://github.com/ICWE2016DockerTutorial/
ChangeDistiller.git
• git clone https://github.com/ICWE2016DockerTutorial/
NodeJSApp.git
• git clone https://github.com/ICWE2016DockerTutorial/
MongoDB.git
PDF on: http://icwe2016.inf.usi.ch/program/tutorials/docker
47
Case Study 1: ChangeDistiller
https://goo.gl/3h7DGA
We paste the commands we run, live at the following url:
48
Case Study 1: ChangeDistiller
(Simple) Dockerfile for ChangeDistiller
FROM java:openjdk-7u101-jdk
ENV app_dir /usr/src/changedistiller
COPY . ${app_dir}
WORKDIR ${app_dir}
RUN apt-get update && apt-get install -y maven
RUN ${app_dir}/build.sh
RUN mvn install
VOLUME ${app_dir}/target
ENTRYPOINT ["mvn", "test"]
48
Case Study 1: ChangeDistiller
(Simple) Dockerfile for ChangeDistiller
FROM java:openjdk-7u101-jdk
ENV app_dir /usr/src/changedistiller
COPY . ${app_dir}
WORKDIR ${app_dir}
RUN apt-get update && apt-get install -y maven
RUN ${app_dir}/build.sh
RUN mvn install
VOLUME ${app_dir}/target
ENTRYPOINT ["mvn", "test"]
Base Image
48
Case Study 1: ChangeDistiller
(Simple) Dockerfile for ChangeDistiller
FROM java:openjdk-7u101-jdk
ENV app_dir /usr/src/changedistiller
COPY . ${app_dir}
WORKDIR ${app_dir}
RUN apt-get update && apt-get install -y maven
RUN ${app_dir}/build.sh
RUN mvn install
VOLUME ${app_dir}/target
ENTRYPOINT ["mvn", "test"]
Copy sources
Base Image
48
Case Study 1: ChangeDistiller
(Simple) Dockerfile for ChangeDistiller
FROM java:openjdk-7u101-jdk
ENV app_dir /usr/src/changedistiller
COPY . ${app_dir}
WORKDIR ${app_dir}
RUN apt-get update && apt-get install -y maven
RUN ${app_dir}/build.sh
RUN mvn install
VOLUME ${app_dir}/target
ENTRYPOINT ["mvn", "test"]
Copy sources
Base Image
Dependencies
48
Case Study 1: ChangeDistiller
(Simple) Dockerfile for ChangeDistiller
FROM java:openjdk-7u101-jdk
ENV app_dir /usr/src/changedistiller
COPY . ${app_dir}
WORKDIR ${app_dir}
RUN apt-get update && apt-get install -y maven
RUN ${app_dir}/build.sh
RUN mvn install
VOLUME ${app_dir}/target
ENTRYPOINT ["mvn", "test"]
Copy sources
Base Image
Install
Dependencies
48
Case Study 1: ChangeDistiller
(Simple) Dockerfile for ChangeDistiller
FROM java:openjdk-7u101-jdk
ENV app_dir /usr/src/changedistiller
COPY . ${app_dir}
WORKDIR ${app_dir}
RUN apt-get update && apt-get install -y maven
RUN ${app_dir}/build.sh
RUN mvn install
VOLUME ${app_dir}/target
ENTRYPOINT ["mvn", "test"]
Copy sources
Base Image
Install
Dependencies
Volume for
generated files
48
Case Study 1: ChangeDistiller
(Simple) Dockerfile for ChangeDistiller
FROM java:openjdk-7u101-jdk
ENV app_dir /usr/src/changedistiller
COPY . ${app_dir}
WORKDIR ${app_dir}
RUN apt-get update && apt-get install -y maven
RUN ${app_dir}/build.sh
RUN mvn install
VOLUME ${app_dir}/target
ENTRYPOINT ["mvn", "test"]
Copy sources
Base Image
Install
Start/enter at
analysis
Dependencies
Volume for
generated files
49
Case Study 1: ChangeDistiller
docker build -t icwe2016dockertutorial/
changedistiller:master .
Executes in the folder with the Dockerfile. Creates an image
Illustrative execution of Docker commands
docker run --name cd icwe2016dockertutorial/
changedistiller:master
Creates the container and runs the analysis
Context
cd ChangeDistiller
50
Case Study 1: ChangeDistiller
Version Pinning
FROM java:openjdk-7u101-jdk
ENV app_dir /usr/src/changedistiller
COPY . ${app_dir}
WORKDIR ${app_dir}
RUN apt-get update && apt-get install -y maven=3.0.5-3
RUN ${app_dir}/build.sh
RUN mvn install
VOLUME ${app_dir}/target
ENTRYPOINT ["mvn", "test"]
50
Case Study 1: ChangeDistiller
Version Pinning
FROM java:openjdk-7u101-jdk
ENV app_dir /usr/src/changedistiller
COPY . ${app_dir}
WORKDIR ${app_dir}
RUN apt-get update && apt-get install -y maven=3.0.5-3
RUN ${app_dir}/build.sh
RUN mvn install
VOLUME ${app_dir}/target
ENTRYPOINT ["mvn", "test"]
Version Pinning for
Dependencies
51
Docker Hub: Automated/Trusted Build
Improves transparency
https://docs.docker.com/docker-hub/builds/
Docker Hub
51
Docker Hub: Automated/Trusted Build
Improves transparency
https://docs.docker.com/docker-hub/builds/
Docker Hubpush
51
Docker Hub: Automated/Trusted Build
Improves transparency
https://docs.docker.com/docker-hub/builds/
Docker Hubbuildpush
Recap: Challenges in Reproducibility
> No standard way of describing experiments, environments,
(derived) data, and workflows
> No transparency in creating environments and the steps/methods
to establish facts or recreate analysis



> Experimental nature of research code and ecosystems makes it
often hard to build
> Unresolved or undocumented dependencies
> Trusted infrastructure for storage and distribution
52
Recap: Challenges in Reproducibility
> No standard way of describing experiments, environments,
(derived) data, and workflows
> No transparency in creating environments and the steps/methods
to establish facts or recreate analysis



> Experimental nature of research code and ecosystems makes it
often hard to build
> Unresolved or undocumented dependencies
> Trusted infrastructure for storage and distribution
Dockerfile
Dockerfile
52
Recap: Challenges in Reproducibility
> No standard way of describing experiments, environments,
(derived) data, and workflows
> No transparency in creating environments and the steps/methods
to establish facts or recreate analysis



> Experimental nature of research code and ecosystems makes it
often hard to build
> Unresolved or undocumented dependencies
> Trusted infrastructure for storage and distribution
Dockerfile
Docker Image
Dockerfile
52
Recap: Challenges in Reproducibility
> No standard way of describing experiments, environments,
(derived) data, and workflows
> No transparency in creating environments and the steps/methods
to establish facts or recreate analysis



> Experimental nature of research code and ecosystems makes it
often hard to build
> Unresolved or undocumented dependencies
> Trusted infrastructure for storage and distribution
Dockerfile
Docker Image
Docker Container
Dockerfile
52
Recap: Challenges in Reproducibility
> No standard way of describing experiments, environments,
(derived) data, and workflows
> No transparency in creating environments and the steps/methods
to establish facts or recreate analysis



> Experimental nature of research code and ecosystems makes it
often hard to build
> Unresolved or undocumented dependencies
> Trusted infrastructure for storage and distribution
Dockerfile
Docker Image
Docker Container
Registries
(Docker Hub, Quay, …)
Dockerfile
52
ICWE 2016, Lugano
Photo Credits: Astrid Westvang, https://flic.kr/p/pWJLCW

Question Time!
Jürgen Cito, Vincenzo Ferme, Harald C. Gall
54
Part III - Multi Containers Docker Application

Preview
Reproduce Bugs present in a Version of a CRUD Web Application
54
Redis
NodeJS App
MongoDB
network
54
Part III - Multi Containers Docker Application

Preview
Reproduce Bugs present in a Version of a CRUD Web Application
54
Redis
NodeJS App
link
MongoDB
link
network
54
Part III - Multi Containers Docker Application

Preview
Reproduce Bugs present in a Version of a CRUD Web Application
54
Redis
NodeJS App
link
MongoDB
link
network
Docker Compose
ICWE 2016, Lugano
Photo Credits: Astrid Westvang, https://flic.kr/p/pWJLCW
End of Part II - Lunch Break!
Jürgen Cito, Vincenzo Ferme, Harald C. Gall
ICWE 2016, Lugano
Photo Credits: Astrid Westvang, https://flic.kr/p/pWJLCW
Part III - Industrial Case Study
Jürgen Cito, Vincenzo Ferme, Harald C. Gall
57
What is Reproducibility?
57
What is Reproducibility?
Challenges in Reproducibility
57
What is Reproducibility?
Single Container Docker Workflow
# Build redis from source
# Make sure you have the redis source code
checked out in
# the same directory as this Dockerfile
FROM ubuntu:12.04
MAINTAINER dockerfiles http://
dockerfiles.github.io
RUN echo "deb http://archive.ubuntu.com/
ubuntu precise main universe" > /etc/apt/
sources.list
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y gcc make g++ build-
essential libc6-dev tcl wget
RUN wget http://download.redis.io/redis-
stable.tar.gz -O - | tar -xvz
# RUN tar -zvzf /redis/redis-stable.tar.gz
RUN (cd /redis-stable && make)
RUN (cd /redis-stable && make test)
RUN mkdir -p /redis-data
VOLUME ["/redis-data"]
EXPOSE 6379
ENTRYPOINT ["/redis-stable/src/redis-
server"]
CMD ["--dir", "/redis-data"]
Dockerfile
build
Image
Docker Image Docker Container
run
Challenges in Reproducibility
58
Multi Containers Docker Workflow
# Build redis from source
# Make sure you have the redis source code
checked out in
# the same directory as this Dockerfile
FROM ubuntu:12.04
MAINTAINER dockerfiles http://
dockerfiles.github.io
RUN echo "deb http://archive.ubuntu.com/
ubuntu precise main universe" > /etc/apt/
sources.list
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y gcc make g++ build-
essential libc6-dev tcl wget
RUN wget http://download.redis.io/redis-
stable.tar.gz -O - | tar -xvz
# RUN tar -zvzf /redis/redis-stable.tar.gz
RUN (cd /redis-stable && make)
RUN (cd /redis-stable && make test)
RUN mkdir -p /redis-data
VOLUME ["/redis-data"]
EXPOSE 6379
ENTRYPOINT ["/redis-stable/src/redis-
server"]
CMD ["--dir", "/redis-data"]
Dockerfile
build
Image
Docker Image Docker Container 1
run
58
Multi Containers Docker Workflow
Docker HubDocker Container 2
run
# Build redis from source
# Make sure you have the redis source code
checked out in
# the same directory as this Dockerfile
FROM ubuntu:12.04
MAINTAINER dockerfiles http://
dockerfiles.github.io
RUN echo "deb http://archive.ubuntu.com/
ubuntu precise main universe" > /etc/apt/
sources.list
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y gcc make g++ build-
essential libc6-dev tcl wget
RUN wget http://download.redis.io/redis-
stable.tar.gz -O - | tar -xvz
# RUN tar -zvzf /redis/redis-stable.tar.gz
RUN (cd /redis-stable && make)
RUN (cd /redis-stable && make test)
RUN mkdir -p /redis-data
VOLUME ["/redis-data"]
EXPOSE 6379
ENTRYPOINT ["/redis-stable/src/redis-
server"]
CMD ["--dir", "/redis-data"]
Dockerfile
build
Image
Docker Image Docker Container 1
run
network
58
Multi Containers Docker Workflow
Docker HubDocker Container 2
run
# Build redis from source
# Make sure you have the redis source code
checked out in
# the same directory as this Dockerfile
FROM ubuntu:12.04
MAINTAINER dockerfiles http://
dockerfiles.github.io
RUN echo "deb http://archive.ubuntu.com/
ubuntu precise main universe" > /etc/apt/
sources.list
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y gcc make g++ build-
essential libc6-dev tcl wget
RUN wget http://download.redis.io/redis-
stable.tar.gz -O - | tar -xvz
# RUN tar -zvzf /redis/redis-stable.tar.gz
RUN (cd /redis-stable && make)
RUN (cd /redis-stable && make test)
RUN mkdir -p /redis-data
VOLUME ["/redis-data"]
EXPOSE 6379
ENTRYPOINT ["/redis-stable/src/redis-
server"]
CMD ["--dir", "/redis-data"]
Dockerfile
build
Image
Docker Image Docker Container 1
run
network
58
Multi Containers Docker Workflow
Docker HubDocker Container 2
run
link
# Build redis from source
# Make sure you have the redis source code
checked out in
# the same directory as this Dockerfile
FROM ubuntu:12.04
MAINTAINER dockerfiles http://
dockerfiles.github.io
RUN echo "deb http://archive.ubuntu.com/
ubuntu precise main universe" > /etc/apt/
sources.list
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y gcc make g++ build-
essential libc6-dev tcl wget
RUN wget http://download.redis.io/redis-
stable.tar.gz -O - | tar -xvz
# RUN tar -zvzf /redis/redis-stable.tar.gz
RUN (cd /redis-stable && make)
RUN (cd /redis-stable && make test)
RUN mkdir -p /redis-data
VOLUME ["/redis-data"]
EXPOSE 6379
ENTRYPOINT ["/redis-stable/src/redis-
server"]
CMD ["--dir", "/redis-data"]
Dockerfile
build
Image
Docker Image Docker Container 1
run
59
Case Study 2: NodeJS + MongoDB + Redis
Reproduce Bugs present in a Version of a CRUD Web Application
Redis
NodeJS App
MongoDB
network
59
Case Study 2: NodeJS + MongoDB + Redis
Reproduce Bugs present in a Version of a CRUD Web Application
Redis
NodeJS App
link
MongoDB
link
network
60
Case Study 2: NodeJS + MongoDB + Redis
Reproduce Bugs present in a Version of a CRUD Web Application
Redis
NodeJS App
link
MongoDB
link
network
# Build redis from source
# Make sure you have the redis source code
checked out in
# the same directory as this Dockerfile
FROM ubuntu:12.04
MAINTAINER dockerfiles http://
dockerfiles.github.io
RUN echo "deb http://archive.ubuntu.com/
ubuntu precise main universe" > /etc/apt/
sources.list
RUN apt-get update
RUN apt-get upgrade -y
Web App
60
Case Study 2: NodeJS + MongoDB + Redis
Reproduce Bugs present in a Version of a CRUD Web Application
Redis
NodeJS App
link
MongoDB
link
network
# Build redis from source
# Make sure you have the redis source code
checked out in
# the same directory as this Dockerfile
FROM ubuntu:12.04
MAINTAINER dockerfiles http://
dockerfiles.github.io
RUN echo "deb http://archive.ubuntu.com/
ubuntu precise main universe" > /etc/apt/
sources.list
RUN apt-get update
RUN apt-get upgrade -y
Custom Schema
and Data
# Build redis from source
# Make sure you have the redis source code
checked out in
# the same directory as this Dockerfile
FROM ubuntu:12.04
MAINTAINER dockerfiles http://
dockerfiles.github.io
RUN echo "deb http://archive.ubuntu.com/
ubuntu precise main universe" > /etc/apt/
sources.list
RUN apt-get update
RUN apt-get upgrade -y
Web App
60
Case Study 2: NodeJS + MongoDB + Redis
Reproduce Bugs present in a Version of a CRUD Web Application
Redis
NodeJS App
link
MongoDB
link
network
# Build redis from source
# Make sure you have the redis source code
checked out in
# the same directory as this Dockerfile
FROM ubuntu:12.04
MAINTAINER dockerfiles http://
dockerfiles.github.io
RUN echo "deb http://archive.ubuntu.com/
ubuntu precise main universe" > /etc/apt/
sources.list
RUN apt-get update
RUN apt-get upgrade -y
Custom Schema
and Data
# Build redis from source
# Make sure you have the redis source code
checked out in
# the same directory as this Dockerfile
FROM ubuntu:12.04
MAINTAINER dockerfiles http://
dockerfiles.github.io
RUN echo "deb http://archive.ubuntu.com/
ubuntu precise main universe" > /etc/apt/
sources.list
RUN apt-get update
RUN apt-get upgrade -y
Web App
61
Docker Networks
docker network ls
61
Docker Networks
NETWORK ID NAME DRIVER
bbd6e3c22dad bridge bridge
d0bcac7befe4 host host
a4f078c19762 none null
docker network ls
61
Docker Networks
docker network create icwe2016
Creates a bridge network named icwe2016
NETWORK ID NAME DRIVER
bbd6e3c22dad bridge bridge
d0bcac7befe4 host host
a4f078c19762 none null
docker network ls
61
Docker Networks
docker network create icwe2016
Creates a bridge network named icwe2016
NETWORK ID NAME DRIVER
bbd6e3c22dad bridge bridge
d0bcac7befe4 host host
a4f078c19762 none null
docker network ls
docker network create -d overlay icwe2016
Creates an overlay network named icwe2016
62
Docker Networks
docker network create icwe2016
62
Docker Networks
docker network create icwe2016
icwe2016
62
Docker Networks
docker network create icwe2016
icwe2016
docker network connect icwe2016 NodeJSApp
Connects NodeJSApp to the icwe2016 network
icwe2016
62
Docker Networks
docker network create icwe2016
icwe2016
docker network connect icwe2016 NodeJSApp
Connects NodeJSApp to the icwe2016 network
icwe2016
NodeJS App
63
Docker Networks
icwe2016
NodeJS App
https://docs.docker.com/engine/reference/commandline/network_create/
Many more possibilities for networks, see full reference here:
63
Docker Networks
icwe2016
NodeJS App
docker run -d --net icwe2016 ... MongoDB
Starts and connects MongoDB to the icwe2016 network
https://docs.docker.com/engine/reference/commandline/network_create/
Many more possibilities for networks, see full reference here:
63
Docker Networks
icwe2016
NodeJS App
docker run -d --net icwe2016 ... MongoDB
Starts and connects MongoDB to the icwe2016 network
MongoDB
https://docs.docker.com/engine/reference/commandline/network_create/
Many more possibilities for networks, see full reference here:
64
Docker Networks
icwe2016
NodeJS App MongoDB
EXPOSE 27017
64
Docker Networks
icwe2016
NodeJS App MongoDB
mongodb:27017 EXPOSE 27017
link
64
Docker Networks
icwe2016
NodeJS App MongoDB
mongodb:27017 EXPOSE 27017
link
Docker takes care of:
• adding the relevant reference to your container’s /etc/hosts
• keeping the link valid across linked containers’ restarts
65
Case Study 2: NodeJS + MongoDB + Redis
Reproduce Bugs present in a Version of a CRUD Web Application
Redis
NodeJS App
link
MongoDB
link
network
# Build redis from source
# Make sure you have the redis source code
checked out in
# the same directory as this Dockerfile
FROM ubuntu:12.04
MAINTAINER dockerfiles http://
dockerfiles.github.io
RUN echo "deb http://archive.ubuntu.com/
ubuntu precise main universe" > /etc/apt/
sources.list
RUN apt-get update
RUN apt-get upgrade -y
Custom Schema
and Data
# Build redis from source
# Make sure you have the redis source code
checked out in
# the same directory as this Dockerfile
FROM ubuntu:12.04
MAINTAINER dockerfiles http://
dockerfiles.github.io
RUN echo "deb http://archive.ubuntu.com/
ubuntu precise main universe" > /etc/apt/
sources.list
RUN apt-get update
RUN apt-get upgrade -y
Web App
66
Case Study 2: NodeJS + MongoDB + Redis
https://goo.gl/3h7DGA
We paste the commands we run, live at the following url:
67
Case Study 2: Web Application
https://github.com/scotch-io/node-todoRepo with the Application we have started from:
67
Case Study 2: Web Application
https://github.com/scotch-io/node-todoRepo with the Application we have started from:
67
Case Study 2: Web Application
https://github.com/scotch-io/node-todoRepo with the Application we have started from:
67
Case Study 2: Web Application
https://github.com/scotch-io/node-todoRepo with the Application we have started from:
+ a couple of bugs, one client-side and one server-side
68
Case Study 2: NodeJS + MongoDB + Redis
Redis
NodeJS App
link
MongoDB
link
network
# Build redis from source
# Make sure you have the redis source code
checked out in
# the same directory as this Dockerfile
FROM ubuntu:12.04
MAINTAINER dockerfiles http://
dockerfiles.github.io
RUN echo "deb http://archive.ubuntu.com/
ubuntu precise main universe" > /etc/apt/
sources.list
RUN apt-get update
RUN apt-get upgrade -y
Custom Schema
and Data
# Build redis from source
# Make sure you have the redis source code
checked out in
# the same directory as this Dockerfile
FROM ubuntu:12.04
MAINTAINER dockerfiles http://
dockerfiles.github.io
RUN echo "deb http://archive.ubuntu.com/
ubuntu precise main universe" > /etc/apt/
sources.list
RUN apt-get update
RUN apt-get upgrade -y
Web App
69
Case Study 2: NodeJS App
Relevant files for Docker
config/database.js
config/redis.js
bin/*
70
Case Study 2: NodeJS App
(Simple) Dockerfile for NodeJS App
FROM node:6.2.0
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package.json /usr/src/app/
RUN npm install
COPY . /usr/src/app
COPY ./bin/wait-for-it.sh /
RUN chmod +x /wait-for-it.sh
COPY ./bin/wait-for-mongo-redis.sh /
RUN chmod +x /wait-for-mongo-redis.sh
EXPOSE 3000
ENTRYPOINT [ "/wait-for-mongo-redis.sh" ]
CMD [ "npm", "start" ]
70
Case Study 2: NodeJS App
(Simple) Dockerfile for NodeJS App
FROM node:6.2.0
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package.json /usr/src/app/
RUN npm install
COPY . /usr/src/app
COPY ./bin/wait-for-it.sh /
RUN chmod +x /wait-for-it.sh
COPY ./bin/wait-for-mongo-redis.sh /
RUN chmod +x /wait-for-mongo-redis.sh
EXPOSE 3000
ENTRYPOINT [ "/wait-for-mongo-redis.sh" ]
CMD [ "npm", "start" ]
Base Image
70
Case Study 2: NodeJS App
(Simple) Dockerfile for NodeJS App
FROM node:6.2.0
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package.json /usr/src/app/
RUN npm install
COPY . /usr/src/app
COPY ./bin/wait-for-it.sh /
RUN chmod +x /wait-for-it.sh
COPY ./bin/wait-for-mongo-redis.sh /
RUN chmod +x /wait-for-mongo-redis.sh
EXPOSE 3000
ENTRYPOINT [ "/wait-for-mongo-redis.sh" ]
CMD [ "npm", "start" ]
App. Dir.
Base Image
70
Case Study 2: NodeJS App
(Simple) Dockerfile for NodeJS App
FROM node:6.2.0
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package.json /usr/src/app/
RUN npm install
COPY . /usr/src/app
COPY ./bin/wait-for-it.sh /
RUN chmod +x /wait-for-it.sh
COPY ./bin/wait-for-mongo-redis.sh /
RUN chmod +x /wait-for-mongo-redis.sh
EXPOSE 3000
ENTRYPOINT [ "/wait-for-mongo-redis.sh" ]
CMD [ "npm", "start" ]
App. Dir.
Base Image
Install
Dependencies
70
Case Study 2: NodeJS App
(Simple) Dockerfile for NodeJS App
FROM node:6.2.0
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package.json /usr/src/app/
RUN npm install
COPY . /usr/src/app
COPY ./bin/wait-for-it.sh /
RUN chmod +x /wait-for-it.sh
COPY ./bin/wait-for-mongo-redis.sh /
RUN chmod +x /wait-for-mongo-redis.sh
EXPOSE 3000
ENTRYPOINT [ "/wait-for-mongo-redis.sh" ]
CMD [ "npm", "start" ]
App. Dir.
Base Image
Install
Dependencies
Copy App.
70
Case Study 2: NodeJS App
(Simple) Dockerfile for NodeJS App
FROM node:6.2.0
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package.json /usr/src/app/
RUN npm install
COPY . /usr/src/app
COPY ./bin/wait-for-it.sh /
RUN chmod +x /wait-for-it.sh
COPY ./bin/wait-for-mongo-redis.sh /
RUN chmod +x /wait-for-mongo-redis.sh
EXPOSE 3000
ENTRYPOINT [ "/wait-for-mongo-redis.sh" ]
CMD [ "npm", "start" ]
App. Dir.
Base Image
Install
Dependencies
Copy App.
Utility
Utility
70
Case Study 2: NodeJS App
(Simple) Dockerfile for NodeJS App
FROM node:6.2.0
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package.json /usr/src/app/
RUN npm install
COPY . /usr/src/app
COPY ./bin/wait-for-it.sh /
RUN chmod +x /wait-for-it.sh
COPY ./bin/wait-for-mongo-redis.sh /
RUN chmod +x /wait-for-mongo-redis.sh
EXPOSE 3000
ENTRYPOINT [ "/wait-for-mongo-redis.sh" ]
CMD [ "npm", "start" ]
App. Dir.
Base Image
Install
Dependencies
Copy App.
Private Port
Utility
Utility
70
Case Study 2: NodeJS App
(Simple) Dockerfile for NodeJS App
FROM node:6.2.0
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package.json /usr/src/app/
RUN npm install
COPY . /usr/src/app
COPY ./bin/wait-for-it.sh /
RUN chmod +x /wait-for-it.sh
COPY ./bin/wait-for-mongo-redis.sh /
RUN chmod +x /wait-for-mongo-redis.sh
EXPOSE 3000
ENTRYPOINT [ "/wait-for-mongo-redis.sh" ]
CMD [ "npm", "start" ]
App. Dir.
Base Image
Install
Dependencies
Copy App.
Enter
Private Port
Utility
Utility
70
Case Study 2: NodeJS App
(Simple) Dockerfile for NodeJS App
FROM node:6.2.0
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package.json /usr/src/app/
RUN npm install
COPY . /usr/src/app
COPY ./bin/wait-for-it.sh /
RUN chmod +x /wait-for-it.sh
COPY ./bin/wait-for-mongo-redis.sh /
RUN chmod +x /wait-for-mongo-redis.sh
EXPOSE 3000
ENTRYPOINT [ "/wait-for-mongo-redis.sh" ]
CMD [ "npm", "start" ]
App. Dir.
Base Image
Install
Dependencies
Copy App.
Enter
Start
Private Port
Utility
Utility
71
Case Study 2: NodeJS App
docker build -t icwe2016dockertutorial/
nodejsapp:master .
Illustrative execution of Docker commands
Context
cd NodeJSApp
72
Case Study 2: NodeJS + MongoDB + Redis
Redis
NodeJS App
link
MongoDB
link
network
# Build redis from source
# Make sure you have the redis source code
checked out in
# the same directory as this Dockerfile
FROM ubuntu:12.04
MAINTAINER dockerfiles http://
dockerfiles.github.io
RUN echo "deb http://archive.ubuntu.com/
ubuntu precise main universe" > /etc/apt/
sources.list
RUN apt-get update
RUN apt-get upgrade -y
Custom Schema
and Data
# Build redis from source
# Make sure you have the redis source code
checked out in
# the same directory as this Dockerfile
FROM ubuntu:12.04
MAINTAINER dockerfiles http://
dockerfiles.github.io
RUN echo "deb http://archive.ubuntu.com/
ubuntu precise main universe" > /etc/apt/
sources.list
RUN apt-get update
RUN apt-get upgrade -y
Web App
73
Case Study 2: MongoDB
Relevant files for Docker
data/*
bin/*
74
Case Study 2: MongoDB
(Simple) Dockerfile for MongoDB with Seed data
FROM mongo:3.3.6
COPY data/seed/icwe2016dockertutorial /data/db/
icwe2016dockertutorial
COPY bin/initialize-mongo.sh /initialize-mongo.sh
RUN chmod +x /initialize-mongo.sh
ENTRYPOINT ["/initialize-mongo.sh"]
CMD ["mongod"]
74
Case Study 2: MongoDB
(Simple) Dockerfile for MongoDB with Seed data
FROM mongo:3.3.6
COPY data/seed/icwe2016dockertutorial /data/db/
icwe2016dockertutorial
COPY bin/initialize-mongo.sh /initialize-mongo.sh
RUN chmod +x /initialize-mongo.sh
ENTRYPOINT ["/initialize-mongo.sh"]
CMD ["mongod"]
Base Image
74
Case Study 2: MongoDB
(Simple) Dockerfile for MongoDB with Seed data
FROM mongo:3.3.6
COPY data/seed/icwe2016dockertutorial /data/db/
icwe2016dockertutorial
COPY bin/initialize-mongo.sh /initialize-mongo.sh
RUN chmod +x /initialize-mongo.sh
ENTRYPOINT ["/initialize-mongo.sh"]
CMD ["mongod"]
Base Image Defines also the private port
74
Case Study 2: MongoDB
(Simple) Dockerfile for MongoDB with Seed data
FROM mongo:3.3.6
COPY data/seed/icwe2016dockertutorial /data/db/
icwe2016dockertutorial
COPY bin/initialize-mongo.sh /initialize-mongo.sh
RUN chmod +x /initialize-mongo.sh
ENTRYPOINT ["/initialize-mongo.sh"]
CMD ["mongod"]
Base Image
Copy Data
Defines also the private port
74
Case Study 2: MongoDB
(Simple) Dockerfile for MongoDB with Seed data
FROM mongo:3.3.6
COPY data/seed/icwe2016dockertutorial /data/db/
icwe2016dockertutorial
COPY bin/initialize-mongo.sh /initialize-mongo.sh
RUN chmod +x /initialize-mongo.sh
ENTRYPOINT ["/initialize-mongo.sh"]
CMD ["mongod"]
Base Image
Utility
Copy Data
Defines also the private port
74
Case Study 2: MongoDB
(Simple) Dockerfile for MongoDB with Seed data
FROM mongo:3.3.6
COPY data/seed/icwe2016dockertutorial /data/db/
icwe2016dockertutorial
COPY bin/initialize-mongo.sh /initialize-mongo.sh
RUN chmod +x /initialize-mongo.sh
ENTRYPOINT ["/initialize-mongo.sh"]
CMD ["mongod"]
Base Image
Utility
Copy Data
Enter
Defines also the private port
74
Case Study 2: MongoDB
(Simple) Dockerfile for MongoDB with Seed data
FROM mongo:3.3.6
COPY data/seed/icwe2016dockertutorial /data/db/
icwe2016dockertutorial
COPY bin/initialize-mongo.sh /initialize-mongo.sh
RUN chmod +x /initialize-mongo.sh
ENTRYPOINT ["/initialize-mongo.sh"]
CMD ["mongod"]
Base Image
Utility
Copy Data
Enter
Start
Defines also the private port
75
Case Study 2: MongoDB
docker build -t icwe2016dockertutorial/
mongodb:master .
Illustrative execution of Docker commands
Context
cd MongoDB
76
Case Study 2: NodeJS + MongoDB + Redis
Redis
NodeJS App
link
MongoDB
link
network
# Build redis from source
# Make sure you have the redis source code
checked out in
# the same directory as this Dockerfile
FROM ubuntu:12.04
MAINTAINER dockerfiles http://
dockerfiles.github.io
RUN echo "deb http://archive.ubuntu.com/
ubuntu precise main universe" > /etc/apt/
sources.list
RUN apt-get update
RUN apt-get upgrade -y
Custom Schema
and Data
# Build redis from source
# Make sure you have the redis source code
checked out in
# the same directory as this Dockerfile
FROM ubuntu:12.04
MAINTAINER dockerfiles http://
dockerfiles.github.io
RUN echo "deb http://archive.ubuntu.com/
ubuntu precise main universe" > /etc/apt/
sources.list
RUN apt-get update
RUN apt-get upgrade -y
Web App
Illustrative execution of Docker commands
77
Case Study 2: Redis
docker pull redis:3.2.0-alpine
78
Case Study 2: Starting the NodeJS App
docker run -d --net icwe2016 --name mongodb
icwe2016dockertutorial/mongodb:masterdocker
docker network create icwe2016
docker run -d --net icwe2016 --name redis
redis:3.2.0-alpine
docker run -d --net icwe2016 -p 8080:3000 --name
nodejsapp icwe2016dockertutorial/nodejsapp:master
Illustrative execution of Docker commands
79
Case Study 2: Connect to the NodeJs App
79
Case Study 2: Connect to the NodeJs App
79
Case Study 2: Connect to the NodeJs App
docker-machine ls
Illustrative execution of Docker commands
79
Case Study 2: Connect to the NodeJs App
docker-machine ls
Illustrative execution of Docker commands
Better solution (in Beta): https://beta.docker.com
80
Case Study 2: Server-side Fix (live)
docker exec -ti nodejsapp bash
Illustrative execution of commands
Context
app/routes.js
Bug: the App. creates the same item twice
docker restart nodejsapp
apt-get update && apt-get install -y vim
vim routers.js  exit
81
Docker in Continuous Integration and Delivery
Live
Fix
CI
CD
+
+
81
Docker in Continuous Integration and Delivery
Local
Build
Image
Live
Fix
CI
CD
+
+
81
Docker in Continuous Integration and Delivery
Local
Build
Image
Live
Fix
CI
CD
+
+
Docker
Hub
Build
Push
81
Docker in Continuous Integration and Delivery
Local
Build
Image
Live
Fix
CI
CD
+
+
Docker
Hub
Build
Push
81
Docker in Continuous Integration and Delivery
Local
Build
Image
Live
Fix
CI
CD
+
+
Docker
Hub
Build
82
Case Study 2: Client-side Fix (new build)
docker build -t icwe2016dockertutorial/
nodejsapp:master .
Illustrative execution of commands (cd NodeJSApp)
Context
public/js/controllers/main.js
Bug: the App. creates empty todos
docker run -d --net icwe2016 -p 8080:3000 --name
nodejsapp icwe2016dockertutorial/nodejsapp:master
docker rm -f -v nodejsapp
83
Case Study 2: Undeploy the App
docker rm -f —v mongodb redis nodejsapp
Illustrative execution of Docker commands
84
Case Study 2: A Better Way of Starting the NodeJS App
Docker Compose
85
Docker Compose
A tool for defining and running multi-container Docker applications
version: '2'
build:
services:
mongodb:
...
redis:
...
nodejsapp:
...
networks:
icwe2016:
driver: bridge
volumes:
85
Docker Compose
A tool for defining and running multi-container Docker applications
version: '2'
build:
services:
mongodb:
...
redis:
...
nodejsapp:
...
networks:
icwe2016:
driver: bridge
volumes:
Build settings
85
Docker Compose
A tool for defining and running multi-container Docker applications
version: '2'
build:
services:
mongodb:
...
redis:
...
nodejsapp:
...
networks:
icwe2016:
driver: bridge
volumes:
Build settings
Services’ deployment settings
85
Docker Compose
A tool for defining and running multi-container Docker applications
version: '2'
build:
services:
mongodb:
...
redis:
...
nodejsapp:
...
networks:
icwe2016:
driver: bridge
volumes:
Build settings
Services’ deployment settings
Networks’ settings
85
Docker Compose
A tool for defining and running multi-container Docker applications
version: '2'
build:
services:
mongodb:
...
redis:
...
nodejsapp:
...
networks:
icwe2016:
driver: bridge
volumes:
Build settings
Services’ deployment settings
Networks’ settings
Volumes’ settings
86
Docker Compose
A tool for defining and running multi-container Docker applications
docker-compose up -d
docker-compose start MongoDB
docker-compose logs
https://docs.docker.com/compose/reference/
Many more possibilities, see full reference here:
86
Docker Compose
A tool for defining and running multi-container Docker applications
docker-compose up -d
Starts the services and detaches from the command
docker-compose start MongoDB
docker-compose logs
https://docs.docker.com/compose/reference/
Many more possibilities, see full reference here:
86
Docker Compose
A tool for defining and running multi-container Docker applications
docker-compose up -d
Starts the services and detaches from the command
docker-compose start MongoDB
Starts the MongoDB service
docker-compose logs
https://docs.docker.com/compose/reference/
Many more possibilities, see full reference here:
86
Docker Compose
A tool for defining and running multi-container Docker applications
docker-compose up -d
Starts the services and detaches from the command
docker-compose start MongoDB
Starts the MongoDB service
docker-compose logs
Shows the aggregated logs from all the services
https://docs.docker.com/compose/reference/
Many more possibilities, see full reference here:
87
Case Study 2: Docker Compose File (1/4)
version: '2'
services:
mongodb:
...
redis:
...
nodejsapp:
...
networks:
icwe2016:
driver: bridge
Context
cd NodeJSApp
87
Case Study 2: Docker Compose File (1/4)
version: '2'
services:
mongodb:
...
redis:
...
nodejsapp:
...
networks:
icwe2016:
driver: bridge
Services’ deployment settings
Context
cd NodeJSApp
87
Case Study 2: Docker Compose File (1/4)
version: '2'
services:
mongodb:
...
redis:
...
nodejsapp:
...
networks:
icwe2016:
driver: bridge
Services’ deployment settings
Networks’ settings
Context
cd NodeJSApp
88
Case Study 2: Docker Compose File (2/4)
services:
mongodb:
image: icwe2016dockertutorial/mongodb:master
container_name: mongodb
# make it explicit the ports exposed by the Dockefile
expose:
- 27017
# make it explicit the volumes exposed by the Dockerfile
volumes:
- /data/db
- /data/configdb
networks:
- icwe2016
89
Case Study 2: Docker Compose File (3/4)
redis:
image: redis:3.2.0-alpine
container_name: redis
# make it explicit the ports exposed by the Dockefile
expose:
- 6379
# make it explicit the volumes exposed by the Dockerfile
volumes:
- /data
networks:
- icwe2016
90
Case Study 2: Docker Compose File (4/4)
nodejsapp:
image: icwe2016dockertutorial/nodejsapp:master
container_name: nodejsapp
# make it explicit the ports exposed by the Dockefile
expose:
- 3000
depends_on:
- mongodb
- redis
ports:
- "8080:3000"
networks:
- icwe2016
91
Case Study 2: Starting the NodeJS App
with Docker Compose
docker-compose up -d
Starts the services and detaches from the command
docker-compose logs -f
Shows and follows the aggregated logs from all the services
Illustrative execution of Docker commands
Context
cd NodeJSApp
92
Recap: Multi Containers Deployment
92
Recap: Multi Containers Deployment
> There are many images on the Docker Hub which we can
reuse
92
Recap: Multi Containers Deployment
> There are many images on the Docker Hub which we can
reuse
> Docker simplifies the reproducibility of bugs because we
can always refer to the image built for a specific version
92
Recap: Multi Containers Deployment
> There are many images on the Docker Hub which we can
reuse
> Docker simplifies the reproducibility of bugs because we
can always refer to the image built for a specific version
> Docker speeds up the debugging of applications composed
of many services
92
Recap: Multi Containers Deployment
> There are many images on the Docker Hub which we can
reuse
> Docker simplifies the reproducibility of bugs because we
can always refer to the image built for a specific version
> Docker speeds up the debugging of applications composed
of many services
> Docker provides network abstraction for portable
deployments of multi container services
92
Recap: Multi Containers Deployment
> There are many images on the Docker Hub which we can
reuse
> Docker simplifies the reproducibility of bugs because we
can always refer to the image built for a specific version
> Docker speeds up the debugging of applications composed
of many services
> Docker provides network abstraction for portable
deployments of multi container services
> Docker Compose enables portable deployment descriptors
ICWE 2016, Lugano
Photo Credits: Astrid Westvang, https://flic.kr/p/pWJLCW
End of Part III - Summary Time!
Jürgen Cito, Vincenzo Ferme, Harald C. Gall
94
Steps for Reproducibility
A recipe for enhancing reproducibility with Docker
94
Steps for Reproducibility
A recipe for enhancing reproducibility with Docker
> Provide the source code (documented) on a public
repository
94
Steps for Reproducibility
A recipe for enhancing reproducibility with Docker
> Provide the source code (documented) on a public
repository
> Release the Dockerfiles using version pinning
94
Steps for Reproducibility
A recipe for enhancing reproducibility with Docker
> Provide the source code (documented) on a public
repository
> Release the Dockerfiles using version pinning
> Setup an automated/trusted build on the Docker Hub
94
Steps for Reproducibility
A recipe for enhancing reproducibility with Docker
> Provide the source code (documented) on a public
repository
> Release the Dockerfiles using version pinning
> Setup an automated/trusted build on the Docker Hub
> Provide portable deployment descriptors using Docker
Compose
95
Steps for Reproducibility
Additional useful services
> DOI for Source Code and Docker Images:
• Citable Code

https://guides.github.com/activities/citable-code/
95
Steps for Reproducibility
Additional useful services
> DOI for Source Code and Docker Images:
• Citable Code

https://guides.github.com/activities/citable-code/
• Citable Docker Images

http://www.software.ac.uk/blog/2016-03-29-reproducible-research-citing-
your-execution-environment-using-docker-and-doi
96
Docker’s Limitations
96
Docker’s Limitations
> Not enough for performance experiments 

[Jimenez et al., The Role of Container Technology in Reproducible Computer Systems Research]
96
Docker’s Limitations
> Not enough for performance experiments 

[Jimenez et al., The Role of Container Technology in Reproducible Computer Systems Research]
> Not enough for data-intensive workload

[http://ivory.idyll.org/blog/2015-docker-and-replicating-papers.html, data on http://www.zenodo.org]
96
Docker’s Limitations
> Not enough for performance experiments 

[Jimenez et al., The Role of Container Technology in Reproducible Computer Systems Research]
> Not enough for data-intensive workload

[http://ivory.idyll.org/blog/2015-docker-and-replicating-papers.html, data on http://www.zenodo.org]
> Limits with proprietary software and dependencies
96
Docker’s Limitations
> Not enough for performance experiments 

[Jimenez et al., The Role of Container Technology in Reproducible Computer Systems Research]
> Not enough for data-intensive workload

[http://ivory.idyll.org/blog/2015-docker-and-replicating-papers.html, data on http://www.zenodo.org]
> Limits with proprietary software and dependencies
> Non-Disclosure Agreements / Intellectual Property
96
Docker’s Limitations
> Not enough for performance experiments 

[Jimenez et al., The Role of Container Technology in Reproducible Computer Systems Research]
> Not enough for data-intensive workload

[http://ivory.idyll.org/blog/2015-docker-and-replicating-papers.html, data on http://www.zenodo.org]
> Limits with proprietary software and dependencies
> Non-Disclosure Agreements / Intellectual Property
> Can we build the same artifact from the specification
(Dockerfile) even in 10 years? [Suggestion: Version Pinning]
Sum up and Conclusion
> Containers enable a standard, fast, and easy way of
describing experiments and environments
> Containers help your future self, reviewers, and other
researchers and colleagues to make use and improve
your work
98
Further Reading
> Docker for beginners: 

http://prakhar.me/docker-curriculum/
> Docker Hands-on: 

https://github.com/alexellis/HandsOnDocker/blob/master/Labs.md
> Experience in using Docker for reproducible research: 

http://melissagymrek.com/science/2014/08/29/docker-reproducible-research.html
> Multi-host networking with Docker: 

https://docs.docker.com/engine/userguide/networking/get-started-overlay/
ICWE 2016, Lugano
Photo Credits: Astrid Westvang, https://flic.kr/p/pWJLCW
Question Time!
Jürgen Cito, Vincenzo Ferme, Harald C. Gall
Material: https://github.com/ICWE2016DockerTutorial

https://hub.docker.com/u/icwe2016dockertutorial/
Speakers References + Slides + Material
Slides: http://icwe2016.inf.usi.ch/program/tutorials/docker
Vincenzo Ferme
PhD @ USI
fermev@usi.ch
@VincenzoFerme
Jürgen Cito
PhD @ UZH
cito@ifi.uzh.ch
@citostyle

More Related Content

What's hot

What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...Edureka!
 
Introduction to Docker - VIT Campus
Introduction to Docker - VIT CampusIntroduction to Docker - VIT Campus
Introduction to Docker - VIT CampusAjeet Singh Raina
 
Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...
Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...
Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...Simplilearn
 
Alphorm.com Formation Kubernetes : Installation et Configuration
Alphorm.com Formation Kubernetes : Installation et ConfigurationAlphorm.com Formation Kubernetes : Installation et Configuration
Alphorm.com Formation Kubernetes : Installation et ConfigurationAlphorm
 
Docker Tutorial For Beginners | What Is Docker And How It Works? | Docker Tut...
Docker Tutorial For Beginners | What Is Docker And How It Works? | Docker Tut...Docker Tutorial For Beginners | What Is Docker And How It Works? | Docker Tut...
Docker Tutorial For Beginners | What Is Docker And How It Works? | Docker Tut...Simplilearn
 
Docker Birthday #3 - Intro to Docker Slides
Docker Birthday #3 - Intro to Docker SlidesDocker Birthday #3 - Intro to Docker Slides
Docker Birthday #3 - Intro to Docker SlidesDocker, Inc.
 
Kafka Streams for Java enthusiasts
Kafka Streams for Java enthusiastsKafka Streams for Java enthusiasts
Kafka Streams for Java enthusiastsSlim Baltagi
 
A Gentle Introduction To Docker And All Things Containers
A Gentle Introduction To Docker And All Things ContainersA Gentle Introduction To Docker And All Things Containers
A Gentle Introduction To Docker And All Things ContainersJérôme Petazzoni
 
Docker Swarm for Beginner
Docker Swarm for BeginnerDocker Swarm for Beginner
Docker Swarm for BeginnerShahzad Masud
 
Dockerfile at Guidewire
Dockerfile at GuidewireDockerfile at Guidewire
Dockerfile at GuidewireDocker, Inc.
 
Midi technique - présentation docker
Midi technique - présentation dockerMidi technique - présentation docker
Midi technique - présentation dockerOlivier Eeckhoutte
 
What is Docker Architecture | Edureka
What is Docker Architecture | EdurekaWhat is Docker Architecture | Edureka
What is Docker Architecture | EdurekaEdureka!
 
Docker Swarm 0.2.0
Docker Swarm 0.2.0Docker Swarm 0.2.0
Docker Swarm 0.2.0Docker, Inc.
 
Getting started with Docker
Getting started with DockerGetting started with Docker
Getting started with DockerRavindu Fernando
 
What Is Docker? | What Is Docker And How It Works? | Docker Tutorial For Begi...
What Is Docker? | What Is Docker And How It Works? | Docker Tutorial For Begi...What Is Docker? | What Is Docker And How It Works? | Docker Tutorial For Begi...
What Is Docker? | What Is Docker And How It Works? | Docker Tutorial For Begi...Simplilearn
 
Docker Basic to Advance
Docker Basic to AdvanceDocker Basic to Advance
Docker Basic to AdvanceParas Jain
 
Docker introduction
Docker introductionDocker introduction
Docker introductiondotCloud
 

What's hot (20)

What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
 
Introduction to Docker - VIT Campus
Introduction to Docker - VIT CampusIntroduction to Docker - VIT Campus
Introduction to Docker - VIT Campus
 
Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...
Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...
Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...
 
Alphorm.com Formation Kubernetes : Installation et Configuration
Alphorm.com Formation Kubernetes : Installation et ConfigurationAlphorm.com Formation Kubernetes : Installation et Configuration
Alphorm.com Formation Kubernetes : Installation et Configuration
 
Docker Tutorial For Beginners | What Is Docker And How It Works? | Docker Tut...
Docker Tutorial For Beginners | What Is Docker And How It Works? | Docker Tut...Docker Tutorial For Beginners | What Is Docker And How It Works? | Docker Tut...
Docker Tutorial For Beginners | What Is Docker And How It Works? | Docker Tut...
 
Docker Birthday #3 - Intro to Docker Slides
Docker Birthday #3 - Intro to Docker SlidesDocker Birthday #3 - Intro to Docker Slides
Docker Birthday #3 - Intro to Docker Slides
 
Kafka Streams for Java enthusiasts
Kafka Streams for Java enthusiastsKafka Streams for Java enthusiasts
Kafka Streams for Java enthusiasts
 
A Gentle Introduction To Docker And All Things Containers
A Gentle Introduction To Docker And All Things ContainersA Gentle Introduction To Docker And All Things Containers
A Gentle Introduction To Docker And All Things Containers
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Docker Swarm for Beginner
Docker Swarm for BeginnerDocker Swarm for Beginner
Docker Swarm for Beginner
 
Dockerfile at Guidewire
Dockerfile at GuidewireDockerfile at Guidewire
Dockerfile at Guidewire
 
Midi technique - présentation docker
Midi technique - présentation dockerMidi technique - présentation docker
Midi technique - présentation docker
 
What is Docker Architecture | Edureka
What is Docker Architecture | EdurekaWhat is Docker Architecture | Edureka
What is Docker Architecture | Edureka
 
Docker Swarm 0.2.0
Docker Swarm 0.2.0Docker Swarm 0.2.0
Docker Swarm 0.2.0
 
Getting started with Docker
Getting started with DockerGetting started with Docker
Getting started with Docker
 
What Is Docker? | What Is Docker And How It Works? | Docker Tutorial For Begi...
What Is Docker? | What Is Docker And How It Works? | Docker Tutorial For Begi...What Is Docker? | What Is Docker And How It Works? | Docker Tutorial For Begi...
What Is Docker? | What Is Docker And How It Works? | Docker Tutorial For Begi...
 
Docker Tutorial.pdf
Docker Tutorial.pdfDocker Tutorial.pdf
Docker Tutorial.pdf
 
Docker Basic to Advance
Docker Basic to AdvanceDocker Basic to Advance
Docker Basic to Advance
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
What is Docker
What is DockerWhat is Docker
What is Docker
 

Viewers also liked

Head first docker
Head first dockerHead first docker
Head first dockerHan Qin
 
Deploying Data Science with Docker and AWS
Deploying Data Science with Docker and AWSDeploying Data Science with Docker and AWS
Deploying Data Science with Docker and AWSMatt McDonnell
 
Docker @ Data Science Meetup
Docker @ Data Science MeetupDocker @ Data Science Meetup
Docker @ Data Science MeetupDaniel Nüst
 
Using python and docker for data science
Using python and docker for data scienceUsing python and docker for data science
Using python and docker for data scienceCalvin Giles
 
Docker for data science
Docker for data scienceDocker for data science
Docker for data scienceCalvin Giles
 
Reproducible bioinformatics pipelines with Docker and Anduril
Reproducible bioinformatics pipelines with Docker and AndurilReproducible bioinformatics pipelines with Docker and Anduril
Reproducible bioinformatics pipelines with Docker and AndurilChristian Frech
 
Agile deployment predictive analytics on hadoop
Agile deployment predictive analytics on hadoopAgile deployment predictive analytics on hadoop
Agile deployment predictive analytics on hadoopDataWorks Summit
 
The Case For Docker In Multi-Cloud Enabled Bioinformatics Applications
The Case For Docker In Multi-Cloud Enabled Bioinformatics ApplicationsThe Case For Docker In Multi-Cloud Enabled Bioinformatics Applications
The Case For Docker In Multi-Cloud Enabled Bioinformatics ApplicationsAhmed Abdullah
 
Docker로 서버 개발 편하게 하기
Docker로 서버 개발 편하게 하기Docker로 서버 개발 편하게 하기
Docker로 서버 개발 편하게 하기Dronix
 

Viewers also liked (9)

Head first docker
Head first dockerHead first docker
Head first docker
 
Deploying Data Science with Docker and AWS
Deploying Data Science with Docker and AWSDeploying Data Science with Docker and AWS
Deploying Data Science with Docker and AWS
 
Docker @ Data Science Meetup
Docker @ Data Science MeetupDocker @ Data Science Meetup
Docker @ Data Science Meetup
 
Using python and docker for data science
Using python and docker for data scienceUsing python and docker for data science
Using python and docker for data science
 
Docker for data science
Docker for data scienceDocker for data science
Docker for data science
 
Reproducible bioinformatics pipelines with Docker and Anduril
Reproducible bioinformatics pipelines with Docker and AndurilReproducible bioinformatics pipelines with Docker and Anduril
Reproducible bioinformatics pipelines with Docker and Anduril
 
Agile deployment predictive analytics on hadoop
Agile deployment predictive analytics on hadoopAgile deployment predictive analytics on hadoop
Agile deployment predictive analytics on hadoop
 
The Case For Docker In Multi-Cloud Enabled Bioinformatics Applications
The Case For Docker In Multi-Cloud Enabled Bioinformatics ApplicationsThe Case For Docker In Multi-Cloud Enabled Bioinformatics Applications
The Case For Docker In Multi-Cloud Enabled Bioinformatics Applications
 
Docker로 서버 개발 편하게 하기
Docker로 서버 개발 편하게 하기Docker로 서버 개발 편하게 하기
Docker로 서버 개발 편하게 하기
 

Similar to Using Docker Containers to Improve Reproducibility in Software and Web Engineering

DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline  DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline Docker, Inc.
 
Reproducibility challenges in computational settings: what are they, why shou...
Reproducibility challenges in computational settings: what are they, why shou...Reproducibility challenges in computational settings: what are they, why shou...
Reproducibility challenges in computational settings: what are they, why shou...Research Data Alliance
 
Common primitives in Docker environments
Common primitives in Docker environmentsCommon primitives in Docker environments
Common primitives in Docker environmentsalexandru giurgiu
 
Docker: Containers for Data Science
Docker: Containers for Data ScienceDocker: Containers for Data Science
Docker: Containers for Data ScienceAlessandro Adamo
 
Software Preservation: challenges and opportunities for reproductibility (Sci...
Software Preservation: challenges and opportunities for reproductibility (Sci...Software Preservation: challenges and opportunities for reproductibility (Sci...
Software Preservation: challenges and opportunities for reproductibility (Sci...Roberto Di Cosmo
 
ScilabTEC 2015 - Irill
ScilabTEC 2015 - IrillScilabTEC 2015 - Irill
ScilabTEC 2015 - IrillScilab
 
Using Puppet - Real World Configuration Management
Using Puppet - Real World Configuration ManagementUsing Puppet - Real World Configuration Management
Using Puppet - Real World Configuration ManagementJames Turnbull
 
Docker Clustering - Batteries Included
Docker Clustering - Batteries IncludedDocker Clustering - Batteries Included
Docker Clustering - Batteries IncludedC4Media
 
Using Docker EE to Scale Operational Intelligence at Splunk
Using Docker EE to Scale Operational Intelligence at SplunkUsing Docker EE to Scale Operational Intelligence at Splunk
Using Docker EE to Scale Operational Intelligence at SplunkDocker, Inc.
 
Inria Tech Talk : Comment améliorer la qualité de vos logiciels avec STAMP
Inria Tech Talk : Comment améliorer la qualité de vos logiciels avec STAMPInria Tech Talk : Comment améliorer la qualité de vos logiciels avec STAMP
Inria Tech Talk : Comment améliorer la qualité de vos logiciels avec STAMPStéphanie Roger
 
Docker containers & the Future of Drupal testing
Docker containers & the Future of Drupal testing Docker containers & the Future of Drupal testing
Docker containers & the Future of Drupal testing Ricardo Amaro
 
IAU workshop 2018 day one
IAU workshop 2018 day oneIAU workshop 2018 day one
IAU workshop 2018 day oneWalid Shaari
 
Unleashing Docker with Pipelines in Bitbucket Cloud
Unleashing Docker with Pipelines in Bitbucket CloudUnleashing Docker with Pipelines in Bitbucket Cloud
Unleashing Docker with Pipelines in Bitbucket CloudAtlassian
 
Openbar 7 - Leuven - OpenShift - The Enterprise Container Platform - Piros
Openbar 7 - Leuven - OpenShift - The Enterprise Container Platform - PirosOpenbar 7 - Leuven - OpenShift - The Enterprise Container Platform - Piros
Openbar 7 - Leuven - OpenShift - The Enterprise Container Platform - PirosOpenbar
 
Optimizing Spark Deployments for Containers: Isolation, Safety, and Performan...
Optimizing Spark Deployments for Containers: Isolation, Safety, and Performan...Optimizing Spark Deployments for Containers: Isolation, Safety, and Performan...
Optimizing Spark Deployments for Containers: Isolation, Safety, and Performan...Spark Summit
 
Shestakov Illia "The Sandbox Theory"
Shestakov Illia "The Sandbox Theory"Shestakov Illia "The Sandbox Theory"
Shestakov Illia "The Sandbox Theory"LogeekNightUkraine
 
Why we don’t use the Term DevOps: the Journey to a Product Mindset - Destinat...
Why we don’t use the Term DevOps: the Journey to a Product Mindset - Destinat...Why we don’t use the Term DevOps: the Journey to a Product Mindset - Destinat...
Why we don’t use the Term DevOps: the Journey to a Product Mindset - Destinat...Henning Jacobs
 
Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...
Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...
Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...Patrick Chanezon
 
Caching in Windows Azure
Caching in Windows AzureCaching in Windows Azure
Caching in Windows AzureIdo Flatow
 

Similar to Using Docker Containers to Improve Reproducibility in Software and Web Engineering (20)

DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline  DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline
 
Reproducibility challenges in computational settings: what are they, why shou...
Reproducibility challenges in computational settings: what are they, why shou...Reproducibility challenges in computational settings: what are they, why shou...
Reproducibility challenges in computational settings: what are they, why shou...
 
Common primitives in Docker environments
Common primitives in Docker environmentsCommon primitives in Docker environments
Common primitives in Docker environments
 
Docker: Containers for Data Science
Docker: Containers for Data ScienceDocker: Containers for Data Science
Docker: Containers for Data Science
 
Software Preservation: challenges and opportunities for reproductibility (Sci...
Software Preservation: challenges and opportunities for reproductibility (Sci...Software Preservation: challenges and opportunities for reproductibility (Sci...
Software Preservation: challenges and opportunities for reproductibility (Sci...
 
ScilabTEC 2015 - Irill
ScilabTEC 2015 - IrillScilabTEC 2015 - Irill
ScilabTEC 2015 - Irill
 
Using Puppet - Real World Configuration Management
Using Puppet - Real World Configuration ManagementUsing Puppet - Real World Configuration Management
Using Puppet - Real World Configuration Management
 
Docker Clustering - Batteries Included
Docker Clustering - Batteries IncludedDocker Clustering - Batteries Included
Docker Clustering - Batteries Included
 
Using Docker EE to Scale Operational Intelligence at Splunk
Using Docker EE to Scale Operational Intelligence at SplunkUsing Docker EE to Scale Operational Intelligence at Splunk
Using Docker EE to Scale Operational Intelligence at Splunk
 
Inria Tech Talk : Comment améliorer la qualité de vos logiciels avec STAMP
Inria Tech Talk : Comment améliorer la qualité de vos logiciels avec STAMPInria Tech Talk : Comment améliorer la qualité de vos logiciels avec STAMP
Inria Tech Talk : Comment améliorer la qualité de vos logiciels avec STAMP
 
Docker containers & the Future of Drupal testing
Docker containers & the Future of Drupal testing Docker containers & the Future of Drupal testing
Docker containers & the Future of Drupal testing
 
IAU workshop 2018 day one
IAU workshop 2018 day oneIAU workshop 2018 day one
IAU workshop 2018 day one
 
Unleashing Docker with Pipelines in Bitbucket Cloud
Unleashing Docker with Pipelines in Bitbucket CloudUnleashing Docker with Pipelines in Bitbucket Cloud
Unleashing Docker with Pipelines in Bitbucket Cloud
 
Openbar 7 - Leuven - OpenShift - The Enterprise Container Platform - Piros
Openbar 7 - Leuven - OpenShift - The Enterprise Container Platform - PirosOpenbar 7 - Leuven - OpenShift - The Enterprise Container Platform - Piros
Openbar 7 - Leuven - OpenShift - The Enterprise Container Platform - Piros
 
Optimizing Spark Deployments for Containers: Isolation, Safety, and Performan...
Optimizing Spark Deployments for Containers: Isolation, Safety, and Performan...Optimizing Spark Deployments for Containers: Isolation, Safety, and Performan...
Optimizing Spark Deployments for Containers: Isolation, Safety, and Performan...
 
Shestakov Illia "The Sandbox Theory"
Shestakov Illia "The Sandbox Theory"Shestakov Illia "The Sandbox Theory"
Shestakov Illia "The Sandbox Theory"
 
Of Docker and Drupal
Of Docker and DrupalOf Docker and Drupal
Of Docker and Drupal
 
Why we don’t use the Term DevOps: the Journey to a Product Mindset - Destinat...
Why we don’t use the Term DevOps: the Journey to a Product Mindset - Destinat...Why we don’t use the Term DevOps: the Journey to a Product Mindset - Destinat...
Why we don’t use the Term DevOps: the Journey to a Product Mindset - Destinat...
 
Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...
Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...
Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...
 
Caching in Windows Azure
Caching in Windows AzureCaching in Windows Azure
Caching in Windows Azure
 

More from Vincenzo Ferme

Declarative Performance Testing Automation - Automating Performance Testing f...
Declarative Performance Testing Automation - Automating Performance Testing f...Declarative Performance Testing Automation - Automating Performance Testing f...
Declarative Performance Testing Automation - Automating Performance Testing f...Vincenzo Ferme
 
Continuous Performance Testing for Microservices
Continuous Performance Testing for MicroservicesContinuous Performance Testing for Microservices
Continuous Performance Testing for MicroservicesVincenzo Ferme
 
A Declarative Approach for Performance Tests Execution in Continuous Software...
A Declarative Approach for Performance Tests Execution in Continuous Software...A Declarative Approach for Performance Tests Execution in Continuous Software...
A Declarative Approach for Performance Tests Execution in Continuous Software...Vincenzo Ferme
 
BenchFlow: A Platform for End-to-end Automation of Performance Testing and An...
BenchFlow: A Platform for End-to-end Automation of Performance Testing and An...BenchFlow: A Platform for End-to-end Automation of Performance Testing and An...
BenchFlow: A Platform for End-to-end Automation of Performance Testing and An...Vincenzo Ferme
 
Towards Holistic Continuous Software Performance Assessment
Towards Holistic Continuous Software Performance AssessmentTowards Holistic Continuous Software Performance Assessment
Towards Holistic Continuous Software Performance AssessmentVincenzo Ferme
 
Estimating the Cost for Executing Business Processes in the Cloud
Estimating the Cost for Executing Business Processes in the CloudEstimating the Cost for Executing Business Processes in the Cloud
Estimating the Cost for Executing Business Processes in the CloudVincenzo Ferme
 
Workflow Engine Performance Benchmarking with BenchFlow
Workflow Engine Performance Benchmarking with BenchFlowWorkflow Engine Performance Benchmarking with BenchFlow
Workflow Engine Performance Benchmarking with BenchFlowVincenzo Ferme
 
A Container-Centric Methodology for Benchmarking Workflow Management Systems
A Container-Centric Methodology for Benchmarking Workflow Management SystemsA Container-Centric Methodology for Benchmarking Workflow Management Systems
A Container-Centric Methodology for Benchmarking Workflow Management SystemsVincenzo Ferme
 
Towards a Benchmark for BPMN Engines
Towards a Benchmark for BPMN EnginesTowards a Benchmark for BPMN Engines
Towards a Benchmark for BPMN EnginesVincenzo Ferme
 
BenchFlow, a Framework for Benchmarking BPMN 2.0 Workflow Management Systems
BenchFlow, a Framework for Benchmarking BPMN 2.0 Workflow Management SystemsBenchFlow, a Framework for Benchmarking BPMN 2.0 Workflow Management Systems
BenchFlow, a Framework for Benchmarking BPMN 2.0 Workflow Management SystemsVincenzo Ferme
 
On the Road to Benchmarking BPMN 2.0 Workflow Engines
On the Road to Benchmarking BPMN 2.0 Workflow EnginesOn the Road to Benchmarking BPMN 2.0 Workflow Engines
On the Road to Benchmarking BPMN 2.0 Workflow EnginesVincenzo Ferme
 

More from Vincenzo Ferme (12)

Declarative Performance Testing Automation - Automating Performance Testing f...
Declarative Performance Testing Automation - Automating Performance Testing f...Declarative Performance Testing Automation - Automating Performance Testing f...
Declarative Performance Testing Automation - Automating Performance Testing f...
 
Continuous Performance Testing for Microservices
Continuous Performance Testing for MicroservicesContinuous Performance Testing for Microservices
Continuous Performance Testing for Microservices
 
A Declarative Approach for Performance Tests Execution in Continuous Software...
A Declarative Approach for Performance Tests Execution in Continuous Software...A Declarative Approach for Performance Tests Execution in Continuous Software...
A Declarative Approach for Performance Tests Execution in Continuous Software...
 
BenchFlow: A Platform for End-to-end Automation of Performance Testing and An...
BenchFlow: A Platform for End-to-end Automation of Performance Testing and An...BenchFlow: A Platform for End-to-end Automation of Performance Testing and An...
BenchFlow: A Platform for End-to-end Automation of Performance Testing and An...
 
Towards Holistic Continuous Software Performance Assessment
Towards Holistic Continuous Software Performance AssessmentTowards Holistic Continuous Software Performance Assessment
Towards Holistic Continuous Software Performance Assessment
 
Estimating the Cost for Executing Business Processes in the Cloud
Estimating the Cost for Executing Business Processes in the CloudEstimating the Cost for Executing Business Processes in the Cloud
Estimating the Cost for Executing Business Processes in the Cloud
 
Workflow Engine Performance Benchmarking with BenchFlow
Workflow Engine Performance Benchmarking with BenchFlowWorkflow Engine Performance Benchmarking with BenchFlow
Workflow Engine Performance Benchmarking with BenchFlow
 
A Container-Centric Methodology for Benchmarking Workflow Management Systems
A Container-Centric Methodology for Benchmarking Workflow Management SystemsA Container-Centric Methodology for Benchmarking Workflow Management Systems
A Container-Centric Methodology for Benchmarking Workflow Management Systems
 
Towards a Benchmark for BPMN Engines
Towards a Benchmark for BPMN EnginesTowards a Benchmark for BPMN Engines
Towards a Benchmark for BPMN Engines
 
BenchFlow, a Framework for Benchmarking BPMN 2.0 Workflow Management Systems
BenchFlow, a Framework for Benchmarking BPMN 2.0 Workflow Management SystemsBenchFlow, a Framework for Benchmarking BPMN 2.0 Workflow Management Systems
BenchFlow, a Framework for Benchmarking BPMN 2.0 Workflow Management Systems
 
On the Road to Benchmarking BPMN 2.0 Workflow Engines
On the Road to Benchmarking BPMN 2.0 Workflow EnginesOn the Road to Benchmarking BPMN 2.0 Workflow Engines
On the Road to Benchmarking BPMN 2.0 Workflow Engines
 
Open Data
Open DataOpen Data
Open Data
 

Recently uploaded

A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 

Recently uploaded (20)

A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

Using Docker Containers to Improve Reproducibility in Software and Web Engineering

  • 1. ICWE 2016, Lugano Photo Credits: Astrid Westvang, https://flic.kr/p/pWJLCW Using Docker Containers to Improve Reproducibility in Software and Web Engineering Jürgen Cito, Vincenzo Ferme, Harald C. Gall
  • 2. 2 Jürgen Cito PhD @ UZH Vincenzo Ferme PhD @ USI The speakers
  • 3. 3 This tutorial… Conceptual, more abstract notion of Reproducibility Concrete instructions to aid Reproducibility in Research & Industry
  • 4. 4 Agenda Part I:
 What is Reproducibility?
 A theoretical perspective
  • 5. 4 Agenda Part I:
 What is Reproducibility?
 A theoretical perspective Part II:
 Docker to Aid Reproducibility
 Basics and Case Study 1 (Research Project Case Study)

  • 6. 4 Agenda Part I:
 What is Reproducibility?
 A theoretical perspective Part II:
 Docker to Aid Reproducibility
 Basics and Case Study 1 (Research Project Case Study)
 Part III:
 Docker to Aid Reproducibility
 Advanced Topics and Case Study 2 (Industrial Case Study)

  • 7. Photo Credits: Astrid Westvang, https://flic.kr/p/pWJLCW Part I - What is Reproducibility? Jürgen Cito, Vincenzo Ferme, Harald C. Gall ICWE 2016, Lugano
  • 8. 6 Reproducibility is the ability of an entire experiment or study to be duplicated, either by the same researcher or by someone else working independently. Reproducing an experiment is called replicating it. What is Reproducibility? No research paper can ever be considered to be the final word, and the replication and corroboration of research results is key to the scientific process.
  • 9. 7 What is Reproducibility? Repeatability of a certain process in order to establish a fact or the conditions under which we are able to observe the same fact* A process to share methods, and describe the environment, 
 in order to recreate results. * Mockus et al. “Experiences from replicating a case study to investigate reproducibility of software development.”
  • 10. 8 Scientific Process Experiment Design Data Collection Data Analysis Results Interpretation Hypotheses Reproducibility
  • 11. 9 What is Reproducibility? Establishing facts
 > Steps (or a method) to establish the fact
 > Sharing computational knowledge
  • 12. 9 What is Reproducibility? Establishing facts
 > Steps (or a method) to establish the fact
 > Sharing computational knowledge Controlling environment
 > Execution environment
 > Dependencies
  • 13. 9 What is Reproducibility? Establishing facts
 > Steps (or a method) to establish the fact
 > Sharing computational knowledge Controlling environment
 > Execution environment
 > Dependencies Providing data
 > Ability to interpret data
 > Computational analyses
  • 14. 9 What is Reproducibility? Establishing facts
 > Steps (or a method) to establish the fact
 > Sharing computational knowledge Controlling environment
 > Execution environment
 > Dependencies Providing data
 > Ability to interpret data
 > Computational analyses Low barriers to replicate
 > Comprehensible results
 > Ease of achieving replication
  • 15. 10 What is Reproducibility in SE/WE Research? Algorithms / Computational Analyses Developed Tools or Prototypes Quantitative Evaluations + internal knowledge of the necessary process to derive/establish results

  • 16. 11 In Software Engineering Research:
 - FSE’15/16, MSR’15/16 In Programming Languages Research:
 - PLDI, POPL, OOPSLA Artifact Evaluation & Replication Packages
  • 17. 12 Current State of Sharing Artefacts Researcher’s website
  • 18. Photo Credits: Astrid Westvang, https://flic.kr/p/pWJLCW Part II - Research Project Case Study Jürgen Cito, Vincenzo Ferme, Harald C. Gall ICWE 2016, Lugano
  • 19. 14 Case Study 1: ChangeDistiller https://bitbucket.org/sealuzh/tools-changedistiller Research Project
  • 20. 15 Why is reproducibility hard? Why does it fail?
  • 21. 16 Reasons for Failed Reproducibility (1/2) *https://twitter.com/ianholmes/status/288689712636493824
  • 22. 17Source: Collberg et al., “Measuring Reproducibility in Computer Systems Research”, http://reproducibility.cs.arizona.edu/tr.pdf Reasons for Failed Reproducibility (2/2)
  • 23. 18 Case Study 1: ChangeDistiller https://bitbucket.org/sealuzh/tools-changedistiller Research Project - Developed 2006-2009
 How many Java versions have we passed?
 - Dependencies defined in a Maven pom file
 Are they all still available in the repository?
 - How does analysis in ChangeDistiller work?
 What is the entry point?
  • 25. 19 > No standard way of describing experiments, environments, (derived) data, and workflows Challenges in Reproducibility
  • 26. 19 > No standard way of describing experiments, environments, (derived) data, and workflows > No transparency in creating environments and the steps/ methods to establish facts or recreate analysis Challenges in Reproducibility
  • 27. 19 > No standard way of describing experiments, environments, (derived) data, and workflows > No transparency in creating environments and the steps/ methods to establish facts or recreate analysis > The experimental nature of the research code and ecosystems makes it often hard to build Challenges in Reproducibility
  • 28. 19 > No standard way of describing experiments, environments, (derived) data, and workflows > No transparency in creating environments and the steps/ methods to establish facts or recreate analysis > The experimental nature of the research code and ecosystems makes it often hard to build > Unresolved or undocumented dependencies Challenges in Reproducibility
  • 29. 19 > No standard way of describing experiments, environments, (derived) data, and workflows > No transparency in creating environments and the steps/ methods to establish facts or recreate analysis > The experimental nature of the research code and ecosystems makes it often hard to build > Unresolved or undocumented dependencies > Infrastructure for storage and distribution Challenges in Reproducibility
  • 30. 20 … to the rescue
  • 31. 21 Docker Containers to the rescue (1/2) What is Docker? Docker allows you to package an application with all of its dependencies into a standardized unit for software development* Containers consist of everything that enables software to run:
 > Code
 > Runtime
 > System Tools
 > System Libraries * https://www.docker.com/what-docker
  • 32. 22 Docker Containers to the rescue (2/2) What can Docker be for SE/WE research? Docker allows you to package a 
 - Prototype
 - Proof-of-concept Implementation
 - Computational analysis or experiment 
 with all of its dependencies into a standardized unit for reproducible research * https://www.docker.com/what-docker
  • 33. Technical Overview / Virtual Machines vs Containers “Lightweight” VM
 > Container is an isolated process 
 (“chroot on steroids”)
 > Own process space
 > Own network interface
 > Feels like a VM
 > Shares kernel with the host
 > Isolation through cgroups/namespaces 23 https://www.docker.com/what-is-docker https://blog.docker.com/2016/03/containers-are-not-vms/
  • 34. 24 Docker Engine Centralized runtime environment for containers Enables portability Sole dependency for Docker No Emulation layer (almost no performance impact) https://www.docker.com/products/docker-engine
  • 35. 25 Benefits of Docker Containers (compared to VMs) Fast instantiation (~1-3 seconds)
 Almost native performance
 Transparent build process
 Smaller Images
 Easy to build, share, and publish * https://www.docker.com/what-docker
  • 36. 25 Benefits of Docker Containers (compared to VMs) Fast instantiation (~1-3 seconds)
 Almost native performance
 Transparent build process
 Smaller Images
 Easy to build, share, and publish * https://www.docker.com/what-docker also compared to
 other container technologies
  • 37. 26 Single Container Docker Workflow # Build redis from source # Make sure you have the redis source code checked out in # the same directory as this Dockerfile FROM ubuntu:12.04 MAINTAINER dockerfiles http:// dockerfiles.github.io RUN echo "deb http://archive.ubuntu.com/ ubuntu precise main universe" > /etc/apt/ sources.list RUN apt-get update RUN apt-get upgrade -y RUN apt-get install -y gcc make g++ build- essential libc6-dev tcl wget RUN wget http://download.redis.io/redis- stable.tar.gz -O - | tar -xvz # RUN tar -zvzf /redis/redis-stable.tar.gz RUN (cd /redis-stable && make) RUN (cd /redis-stable && make test) RUN mkdir -p /redis-data VOLUME ["/redis-data"] EXPOSE 6379 ENTRYPOINT ["/redis-stable/src/redis- server"] CMD ["--dir", "/redis-data"] Dockerfile build Image Docker Image Docker Container run
  • 38. 27 Dockerfile
 Declarative definition of an environment for producing an image
 
 Docker Image
 Immutable artifact built from a Dockerfile, has one to many layers Docker Container
 Execution environment - Instantiation/running version of an image (can be parameterized) Docker Machine
 Creates Docker hosts on your local Mac or Windows box Docker Registry
 Public or private repository stores images and allows for their distribution
 (Docker Hub - https://hub.docker.com/ or CoreOS Quay - https://quay.io/) Terminology
  • 39. build 28 Single Container Docker Workflow # Build redis from source # Make sure you have the redis source code checked out in # the same directory as this Dockerfile FROM ubuntu:12.04 MAINTAINER dockerfiles http:// dockerfiles.github.io RUN echo "deb http://archive.ubuntu.com/ ubuntu precise main universe" > /etc/apt/ sources.list RUN apt-get update RUN apt-get upgrade -y RUN apt-get install -y gcc make g++ build- essential libc6-dev tcl wget RUN wget http://download.redis.io/redis- stable.tar.gz -O - | tar -xvz # RUN tar -zvzf /redis/redis-stable.tar.gz RUN (cd /redis-stable && make) RUN (cd /redis-stable && make test) RUN mkdir -p /redis-data VOLUME ["/redis-data"] EXPOSE 6379 ENTRYPOINT ["/redis-stable/src/redis- server"] CMD ["--dir", "/redis-data"] Dockerfile Image Docker Image Docker Container run
  • 40. 29 Dockerfile Defines the infrastructure and dependencies of a container through instructions # Build redis from source # Make sure you have the redis source code checked out in # the same directory as this Dockerfile FROM ubuntu:12.04 MAINTAINER dockerfiles RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/ sources.list RUN apt-get update RUN apt-get upgrade -y RUN apt-get install -y gcc make g++ build-essential libc6-dev tcl wget RUN wget http://download.redis.io/redis-stable.tar.gz -O - | tar -xvz # RUN tar -zvzf /redis/redis-stable.tar.gz RUN (cd /redis-stable && make) RUN (cd /redis-stable && make test) COPY redis.conf /var/www/redis.conf RUN mkdir -p /redis-data VOLUME ["/redis-data"] EXPOSE 6379 ENTRYPOINT ["/redis-stable/src/redis-server"] CMD ["--dir", "/redis-data"]
  • 41. 29 Dockerfile Defines the infrastructure and dependencies of a container through instructions # Build redis from source # Make sure you have the redis source code checked out in # the same directory as this Dockerfile FROM ubuntu:12.04 MAINTAINER dockerfiles RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/ sources.list RUN apt-get update RUN apt-get upgrade -y RUN apt-get install -y gcc make g++ build-essential libc6-dev tcl wget RUN wget http://download.redis.io/redis-stable.tar.gz -O - | tar -xvz # RUN tar -zvzf /redis/redis-stable.tar.gz RUN (cd /redis-stable && make) RUN (cd /redis-stable && make test) COPY redis.conf /var/www/redis.conf RUN mkdir -p /redis-data VOLUME ["/redis-data"] EXPOSE 6379 ENTRYPOINT ["/redis-stable/src/redis-server"] CMD ["--dir", "/redis-data"] Base Image
  • 42. 29 Dockerfile Defines the infrastructure and dependencies of a container through instructions # Build redis from source # Make sure you have the redis source code checked out in # the same directory as this Dockerfile FROM ubuntu:12.04 MAINTAINER dockerfiles RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/ sources.list RUN apt-get update RUN apt-get upgrade -y RUN apt-get install -y gcc make g++ build-essential libc6-dev tcl wget RUN wget http://download.redis.io/redis-stable.tar.gz -O - | tar -xvz # RUN tar -zvzf /redis/redis-stable.tar.gz RUN (cd /redis-stable && make) RUN (cd /redis-stable && make test) COPY redis.conf /var/www/redis.conf RUN mkdir -p /redis-data VOLUME ["/redis-data"] EXPOSE 6379 ENTRYPOINT ["/redis-stable/src/redis-server"] CMD ["--dir", "/redis-data"] Base Image Base Image can be an OS (Ubuntu) or a different, existing image
  • 43. 29 Dockerfile Defines the infrastructure and dependencies of a container through instructions # Build redis from source # Make sure you have the redis source code checked out in # the same directory as this Dockerfile FROM ubuntu:12.04 MAINTAINER dockerfiles RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/ sources.list RUN apt-get update RUN apt-get upgrade -y RUN apt-get install -y gcc make g++ build-essential libc6-dev tcl wget RUN wget http://download.redis.io/redis-stable.tar.gz -O - | tar -xvz # RUN tar -zvzf /redis/redis-stable.tar.gz RUN (cd /redis-stable && make) RUN (cd /redis-stable && make test) COPY redis.conf /var/www/redis.conf RUN mkdir -p /redis-data VOLUME ["/redis-data"] EXPOSE 6379 ENTRYPOINT ["/redis-stable/src/redis-server"] CMD ["--dir", "/redis-data"] Dependencies Base Image Base Image can be an OS (Ubuntu) or a different, existing image
  • 44. 29 Dockerfile Defines the infrastructure and dependencies of a container through instructions # Build redis from source # Make sure you have the redis source code checked out in # the same directory as this Dockerfile FROM ubuntu:12.04 MAINTAINER dockerfiles RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/ sources.list RUN apt-get update RUN apt-get upgrade -y RUN apt-get install -y gcc make g++ build-essential libc6-dev tcl wget RUN wget http://download.redis.io/redis-stable.tar.gz -O - | tar -xvz # RUN tar -zvzf /redis/redis-stable.tar.gz RUN (cd /redis-stable && make) RUN (cd /redis-stable && make test) COPY redis.conf /var/www/redis.conf RUN mkdir -p /redis-data VOLUME ["/redis-data"] EXPOSE 6379 ENTRYPOINT ["/redis-stable/src/redis-server"] CMD ["--dir", "/redis-data"] Dependencies Base Image Base Image can be an OS (Ubuntu) or a different, existing image Runs commands as if you were typing them in the command line
  • 45. 29 Dockerfile Defines the infrastructure and dependencies of a container through instructions # Build redis from source # Make sure you have the redis source code checked out in # the same directory as this Dockerfile FROM ubuntu:12.04 MAINTAINER dockerfiles RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/ sources.list RUN apt-get update RUN apt-get upgrade -y RUN apt-get install -y gcc make g++ build-essential libc6-dev tcl wget RUN wget http://download.redis.io/redis-stable.tar.gz -O - | tar -xvz # RUN tar -zvzf /redis/redis-stable.tar.gz RUN (cd /redis-stable && make) RUN (cd /redis-stable && make test) COPY redis.conf /var/www/redis.conf RUN mkdir -p /redis-data VOLUME ["/redis-data"] EXPOSE 6379 ENTRYPOINT ["/redis-stable/src/redis-server"] CMD ["--dir", "/redis-data"] Dependencies Base Image Install Base Image can be an OS (Ubuntu) or a different, existing image Runs commands as if you were typing them in the command line
  • 46. 29 Dockerfile Defines the infrastructure and dependencies of a container through instructions # Build redis from source # Make sure you have the redis source code checked out in # the same directory as this Dockerfile FROM ubuntu:12.04 MAINTAINER dockerfiles RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/ sources.list RUN apt-get update RUN apt-get upgrade -y RUN apt-get install -y gcc make g++ build-essential libc6-dev tcl wget RUN wget http://download.redis.io/redis-stable.tar.gz -O - | tar -xvz # RUN tar -zvzf /redis/redis-stable.tar.gz RUN (cd /redis-stable && make) RUN (cd /redis-stable && make test) COPY redis.conf /var/www/redis.conf RUN mkdir -p /redis-data VOLUME ["/redis-data"] EXPOSE 6379 ENTRYPOINT ["/redis-stable/src/redis-server"] CMD ["--dir", "/redis-data"] Dependencies Base Image Install Base Image can be an OS (Ubuntu) or a different, existing image Runs commands as if you were typing them in the command line Copies local files from build context into container
  • 47. 29 Dockerfile Defines the infrastructure and dependencies of a container through instructions # Build redis from source # Make sure you have the redis source code checked out in # the same directory as this Dockerfile FROM ubuntu:12.04 MAINTAINER dockerfiles RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/ sources.list RUN apt-get update RUN apt-get upgrade -y RUN apt-get install -y gcc make g++ build-essential libc6-dev tcl wget RUN wget http://download.redis.io/redis-stable.tar.gz -O - | tar -xvz # RUN tar -zvzf /redis/redis-stable.tar.gz RUN (cd /redis-stable && make) RUN (cd /redis-stable && make test) COPY redis.conf /var/www/redis.conf RUN mkdir -p /redis-data VOLUME ["/redis-data"] EXPOSE 6379 ENTRYPOINT ["/redis-stable/src/redis-server"] CMD ["--dir", "/redis-data"] Dependencies Base Image Install Volume Base Image can be an OS (Ubuntu) or a different, existing image Runs commands as if you were typing them in the command line Copies local files from build context into container
  • 48. 29 Dockerfile Defines the infrastructure and dependencies of a container through instructions # Build redis from source # Make sure you have the redis source code checked out in # the same directory as this Dockerfile FROM ubuntu:12.04 MAINTAINER dockerfiles RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/ sources.list RUN apt-get update RUN apt-get upgrade -y RUN apt-get install -y gcc make g++ build-essential libc6-dev tcl wget RUN wget http://download.redis.io/redis-stable.tar.gz -O - | tar -xvz # RUN tar -zvzf /redis/redis-stable.tar.gz RUN (cd /redis-stable && make) RUN (cd /redis-stable && make test) COPY redis.conf /var/www/redis.conf RUN mkdir -p /redis-data VOLUME ["/redis-data"] EXPOSE 6379 ENTRYPOINT ["/redis-stable/src/redis-server"] CMD ["--dir", "/redis-data"] Dependencies Base Image Install Open Port Volume Base Image can be an OS (Ubuntu) or a different, existing image Runs commands as if you were typing them in the command line Copies local files from build context into container
  • 49. 29 Dockerfile Defines the infrastructure and dependencies of a container through instructions # Build redis from source # Make sure you have the redis source code checked out in # the same directory as this Dockerfile FROM ubuntu:12.04 MAINTAINER dockerfiles RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/ sources.list RUN apt-get update RUN apt-get upgrade -y RUN apt-get install -y gcc make g++ build-essential libc6-dev tcl wget RUN wget http://download.redis.io/redis-stable.tar.gz -O - | tar -xvz # RUN tar -zvzf /redis/redis-stable.tar.gz RUN (cd /redis-stable && make) RUN (cd /redis-stable && make test) COPY redis.conf /var/www/redis.conf RUN mkdir -p /redis-data VOLUME ["/redis-data"] EXPOSE 6379 ENTRYPOINT ["/redis-stable/src/redis-server"] CMD ["--dir", "/redis-data"] Dependencies Base Image Install Open Port Start Server Volume Base Image can be an OS (Ubuntu) or a different, existing image Runs commands as if you were typing them in the command line Copies local files from build context into container
  • 50. 30 Data Volumes A specially-designated directory within one or more containers that bypasses the Union File System*
 
 Volumes allow you to manage data within containers
 > Mount a host directory (dependency to the host filesystem)
 > Mount a data volume container (dependency to another container)
 > Mount a shared-storage volume (NFS, iSCSI, etc.) * https://docs.docker.com/engine/userguide/containers/dockervolumes/
  • 51. 31 Single Container Docker Workflow # Build redis from source # Make sure you have the redis source code checked out in # the same directory as this Dockerfile FROM ubuntu:12.04 MAINTAINER dockerfiles http:// dockerfiles.github.io RUN echo "deb http://archive.ubuntu.com/ ubuntu precise main universe" > /etc/apt/ sources.list RUN apt-get update RUN apt-get upgrade -y RUN apt-get install -y gcc make g++ build- essential libc6-dev tcl wget RUN wget http://download.redis.io/redis- stable.tar.gz -O - | tar -xvz # RUN tar -zvzf /redis/redis-stable.tar.gz RUN (cd /redis-stable && make) RUN (cd /redis-stable && make test) RUN mkdir -p /redis-data VOLUME ["/redis-data"] EXPOSE 6379 ENTRYPOINT ["/redis-stable/src/redis- server"] CMD ["--dir", "/redis-data"] Dockerfile build Image Docker Image Docker Container run
  • 52. 32 Dockerfile —> Image Defines the infrastructure and dependencies of a container through instructions docker build -t <imagename> .
  • 53. 32 Dockerfile —> Image Defines the infrastructure and dependencies of a container through instructions docker build -t <imagename> . Build Context containing all local dependencies and Dockerfile
  • 54. 33 Docker Images # docker images REPOSITORY TAG IMAGE ID CREATED SIZE mhart/alpine-node latest 2a15d8568f75 1 week ago 36.76 MB hakyll latest d575da1e730c 2 weeks ago 1.487 GB redis alpine 50405530a7e5 4 weeks ago 15.95 MB # docker rmi hakyll Untagged: hakyll:latest Deleted: sha256:3240943c9ea3f72db51… Deleted: sha256:a3aeefae0d4b8f61… Deleted: sha256:16a7ebd378002f1261…
  • 55. 33 Docker Images # docker images REPOSITORY TAG IMAGE ID CREATED SIZE mhart/alpine-node latest 2a15d8568f75 1 week ago 36.76 MB hakyll latest d575da1e730c 2 weeks ago 1.487 GB redis alpine 50405530a7e5 4 weeks ago 15.95 MB # docker rmi hakyll Untagged: hakyll:latest Deleted: sha256:3240943c9ea3f72db51… Deleted: sha256:a3aeefae0d4b8f61… Deleted: sha256:16a7ebd378002f1261… Lists all previously built images
  • 56. 33 Docker Images # docker images REPOSITORY TAG IMAGE ID CREATED SIZE mhart/alpine-node latest 2a15d8568f75 1 week ago 36.76 MB hakyll latest d575da1e730c 2 weeks ago 1.487 GB redis alpine 50405530a7e5 4 weeks ago 15.95 MB # docker rmi hakyll Untagged: hakyll:latest Deleted: sha256:3240943c9ea3f72db51… Deleted: sha256:a3aeefae0d4b8f61… Deleted: sha256:16a7ebd378002f1261… Lists all previously built images Removes an image ‘hakyll:latest’ and all its layers from the disk
  • 57. 34 Single Container Docker Workflow # Build redis from source # Make sure you have the redis source code checked out in # the same directory as this Dockerfile FROM ubuntu:12.04 MAINTAINER dockerfiles http:// dockerfiles.github.io RUN echo "deb http://archive.ubuntu.com/ ubuntu precise main universe" > /etc/apt/ sources.list RUN apt-get update RUN apt-get upgrade -y RUN apt-get install -y gcc make g++ build- essential libc6-dev tcl wget RUN wget http://download.redis.io/redis- stable.tar.gz -O - | tar -xvz # RUN tar -zvzf /redis/redis-stable.tar.gz RUN (cd /redis-stable && make) RUN (cd /redis-stable && make test) RUN mkdir -p /redis-data VOLUME ["/redis-data"] EXPOSE 6379 ENTRYPOINT ["/redis-stable/src/redis- server"] CMD ["--dir", "/redis-data"] Dockerfile build Image Docker Image run Docker Container
  • 58. 35 Image —> Container docker run -d --name <containername> -p 80:5000 <imagename> https://docs.docker.com/engine/reference/run/ Many more possibilities to run containers, see full reference here: (A typical example)
  • 59. 35 Image —> Container docker run -d --name <containername> -p 80:5000 <imagename> Run container in the background
 (d for daemon) https://docs.docker.com/engine/reference/run/ Many more possibilities to run containers, see full reference here: (A typical example)
  • 60. 35 Image —> Container docker run -d --name <containername> -p 80:5000 <imagename> Run container in the background
 (d for daemon) https://docs.docker.com/engine/reference/run/ Give the container a unique name Many more possibilities to run containers, see full reference here: (A typical example)
  • 61. 35 Image —> Container docker run -d --name <containername> -p 80:5000 <imagename> Run container in the background
 (d for daemon) https://docs.docker.com/engine/reference/run/ Give the container a unique name Port mapping
 First the exposed port (80) Second the port within the container (5000) Many more possibilities to run containers, see full reference here: (A typical example)
  • 62. 36 Container Management docker ps docker ps -a docker stop <container> docker rm <container> docker rm -v <container>
  • 63. 36 Container Management docker ps Lists all running containers docker ps -a docker stop <container> docker rm <container> docker rm -v <container>
  • 64. 36 Container Management docker ps Lists all running containers docker ps -a Lists all containers (including the ones that are stopped) docker stop <container> docker rm <container> docker rm -v <container>
  • 65. 36 Container Management docker ps Lists all running containers docker ps -a Lists all containers (including the ones that are stopped) docker stop <container> Stops a running container docker rm <container> docker rm -v <container>
  • 66. 36 Container Management docker ps Lists all running containers docker ps -a Lists all containers (including the ones that are stopped) docker stop <container> Stops a running container docker rm <container> Removes a stopped container docker rm -v <container>
  • 67. 36 Container Management docker ps Lists all running containers docker ps -a Lists all containers (including the ones that are stopped) docker stop <container> Stops a running container docker rm <container> Removes a stopped container docker rm -v <container> Removes a stopped container and its volumes
  • 68. 37 Container Debugging docker run -ti --entrypoint=bash <imagename> docker exec -ti <container> bash docker inspect <container> docker logs <container>
  • 69. 37 Container Debugging docker run -ti --entrypoint=bash <imagename> docker exec -ti <container> bash docker inspect <container> Low-level information on a container or image docker logs <container>
  • 70. 37 Container Debugging docker run -ti --entrypoint=bash <imagename> docker exec -ti <container> bash docker inspect <container> Low-level information on a container or image docker logs <container> Retrieves logs printed to stdout/err within the container
  • 71. 37 Container Debugging docker run -ti --entrypoint=bash <imagename> docker exec -ti <container> bash Starts an interactive shell into a running container docker inspect <container> Low-level information on a container or image docker logs <container> Retrieves logs printed to stdout/err within the container
  • 72. 37 Container Debugging docker run -ti --entrypoint=bash <imagename> Starts a container with a different entrypoint docker exec -ti <container> bash Starts an interactive shell into a running container docker inspect <container> Low-level information on a container or image docker logs <container> Retrieves logs printed to stdout/err within the container
  • 74. 39 Pulling Docker Images
 Getting started with existing images docker pull nginx:latest
  • 75. 40 Pulling Docker Images
 Getting started with existing images docker pull nginx:latest Reference to a Docker Image in the Docker Hub
  • 76. 41 Pulling Docker Images
 Getting started with existing images docker pull nginx:latest Images can have many “tags”
  • 77. 42 Pulling Docker Images
 Getting started with existing images docker pull nginx:latest Pulls an image from a Docker registry
  • 78. 43 Pushing Docker Images to a Registry
 Tag Image docker tag c6fdd6639541 <username>/<imagename>:<tagname> Image Id 
 (retrieve through )docker images
  • 79. 44 Pushing Docker Images to a Registry
 Push Image
  • 80. 44 Pushing Docker Images to a Registry
 Push Image docker login --username=<username> --email=<email>
  • 81. 44 Pushing Docker Images to a Registry
 Push Image docker login --username=<username> --email=<email> docker push <username>/<imagename>:<tagname>
  • 82. 45 Case Study 1: ChangeDistiller https://bitbucket.org/sealuzh/tools-changedistiller Research Project # Build redis from source # Make sure you have the redis source code checked out in # the same directory as this Dockerfile FROM ubuntu:12.04 MAINTAINER dockerfiles http:// dockerfiles.github.io RUN echo "deb http://archive.ubuntu.com/ ubuntu precise main universe" > /etc/apt/ sources.list RUN apt-get update RUN apt-get upgrade -y RUN apt-get install -y gcc make g++ build- essential libc6-dev tcl wget RUN wget http://download.redis.io/redis- stable.tar.gz -O - | tar -xvz # RUN tar -zvzf /redis/redis-stable.tar.gz RUN (cd /redis-stable && make) RUN (cd /redis-stable && make test) RUN mkdir -p /redis-data VOLUME ["/redis-data"] EXPOSE 6379 ENTRYPOINT ["/redis-stable/src/redis- server"] CMD ["--dir", "/redis-data"] Dockerfile build Image Docker Image Docker Container run
  • 83. 46 Prerequisites for attending the tutorial Prerequisites • git on your terminal • OSX or Windows: Docker Toolbox, https://www.docker.com/products/ docker-toolbox. Then follow the getting started guide on the same page. • Linux: 1) https://docs.docker.com/linux/, 2) https://docs.docker.com/ machine/install-machine/, 3) https://docs.docker.com/compose/install/ Git clone • git clone https://github.com/ICWE2016DockerTutorial/ ChangeDistiller.git • git clone https://github.com/ICWE2016DockerTutorial/ NodeJSApp.git • git clone https://github.com/ICWE2016DockerTutorial/ MongoDB.git PDF on: http://icwe2016.inf.usi.ch/program/tutorials/docker
  • 84. 47 Case Study 1: ChangeDistiller https://goo.gl/3h7DGA We paste the commands we run, live at the following url:
  • 85. 48 Case Study 1: ChangeDistiller (Simple) Dockerfile for ChangeDistiller FROM java:openjdk-7u101-jdk ENV app_dir /usr/src/changedistiller COPY . ${app_dir} WORKDIR ${app_dir} RUN apt-get update && apt-get install -y maven RUN ${app_dir}/build.sh RUN mvn install VOLUME ${app_dir}/target ENTRYPOINT ["mvn", "test"]
  • 86. 48 Case Study 1: ChangeDistiller (Simple) Dockerfile for ChangeDistiller FROM java:openjdk-7u101-jdk ENV app_dir /usr/src/changedistiller COPY . ${app_dir} WORKDIR ${app_dir} RUN apt-get update && apt-get install -y maven RUN ${app_dir}/build.sh RUN mvn install VOLUME ${app_dir}/target ENTRYPOINT ["mvn", "test"] Base Image
  • 87. 48 Case Study 1: ChangeDistiller (Simple) Dockerfile for ChangeDistiller FROM java:openjdk-7u101-jdk ENV app_dir /usr/src/changedistiller COPY . ${app_dir} WORKDIR ${app_dir} RUN apt-get update && apt-get install -y maven RUN ${app_dir}/build.sh RUN mvn install VOLUME ${app_dir}/target ENTRYPOINT ["mvn", "test"] Copy sources Base Image
  • 88. 48 Case Study 1: ChangeDistiller (Simple) Dockerfile for ChangeDistiller FROM java:openjdk-7u101-jdk ENV app_dir /usr/src/changedistiller COPY . ${app_dir} WORKDIR ${app_dir} RUN apt-get update && apt-get install -y maven RUN ${app_dir}/build.sh RUN mvn install VOLUME ${app_dir}/target ENTRYPOINT ["mvn", "test"] Copy sources Base Image Dependencies
  • 89. 48 Case Study 1: ChangeDistiller (Simple) Dockerfile for ChangeDistiller FROM java:openjdk-7u101-jdk ENV app_dir /usr/src/changedistiller COPY . ${app_dir} WORKDIR ${app_dir} RUN apt-get update && apt-get install -y maven RUN ${app_dir}/build.sh RUN mvn install VOLUME ${app_dir}/target ENTRYPOINT ["mvn", "test"] Copy sources Base Image Install Dependencies
  • 90. 48 Case Study 1: ChangeDistiller (Simple) Dockerfile for ChangeDistiller FROM java:openjdk-7u101-jdk ENV app_dir /usr/src/changedistiller COPY . ${app_dir} WORKDIR ${app_dir} RUN apt-get update && apt-get install -y maven RUN ${app_dir}/build.sh RUN mvn install VOLUME ${app_dir}/target ENTRYPOINT ["mvn", "test"] Copy sources Base Image Install Dependencies Volume for generated files
  • 91. 48 Case Study 1: ChangeDistiller (Simple) Dockerfile for ChangeDistiller FROM java:openjdk-7u101-jdk ENV app_dir /usr/src/changedistiller COPY . ${app_dir} WORKDIR ${app_dir} RUN apt-get update && apt-get install -y maven RUN ${app_dir}/build.sh RUN mvn install VOLUME ${app_dir}/target ENTRYPOINT ["mvn", "test"] Copy sources Base Image Install Start/enter at analysis Dependencies Volume for generated files
  • 92. 49 Case Study 1: ChangeDistiller docker build -t icwe2016dockertutorial/ changedistiller:master . Executes in the folder with the Dockerfile. Creates an image Illustrative execution of Docker commands docker run --name cd icwe2016dockertutorial/ changedistiller:master Creates the container and runs the analysis Context cd ChangeDistiller
  • 93. 50 Case Study 1: ChangeDistiller Version Pinning FROM java:openjdk-7u101-jdk ENV app_dir /usr/src/changedistiller COPY . ${app_dir} WORKDIR ${app_dir} RUN apt-get update && apt-get install -y maven=3.0.5-3 RUN ${app_dir}/build.sh RUN mvn install VOLUME ${app_dir}/target ENTRYPOINT ["mvn", "test"]
  • 94. 50 Case Study 1: ChangeDistiller Version Pinning FROM java:openjdk-7u101-jdk ENV app_dir /usr/src/changedistiller COPY . ${app_dir} WORKDIR ${app_dir} RUN apt-get update && apt-get install -y maven=3.0.5-3 RUN ${app_dir}/build.sh RUN mvn install VOLUME ${app_dir}/target ENTRYPOINT ["mvn", "test"] Version Pinning for Dependencies
  • 95. 51 Docker Hub: Automated/Trusted Build Improves transparency https://docs.docker.com/docker-hub/builds/ Docker Hub
  • 96. 51 Docker Hub: Automated/Trusted Build Improves transparency https://docs.docker.com/docker-hub/builds/ Docker Hubpush
  • 97. 51 Docker Hub: Automated/Trusted Build Improves transparency https://docs.docker.com/docker-hub/builds/ Docker Hubbuildpush
  • 98. Recap: Challenges in Reproducibility > No standard way of describing experiments, environments, (derived) data, and workflows > No transparency in creating environments and the steps/methods to establish facts or recreate analysis
 
 > Experimental nature of research code and ecosystems makes it often hard to build > Unresolved or undocumented dependencies > Trusted infrastructure for storage and distribution 52
  • 99. Recap: Challenges in Reproducibility > No standard way of describing experiments, environments, (derived) data, and workflows > No transparency in creating environments and the steps/methods to establish facts or recreate analysis
 
 > Experimental nature of research code and ecosystems makes it often hard to build > Unresolved or undocumented dependencies > Trusted infrastructure for storage and distribution Dockerfile Dockerfile 52
  • 100. Recap: Challenges in Reproducibility > No standard way of describing experiments, environments, (derived) data, and workflows > No transparency in creating environments and the steps/methods to establish facts or recreate analysis
 
 > Experimental nature of research code and ecosystems makes it often hard to build > Unresolved or undocumented dependencies > Trusted infrastructure for storage and distribution Dockerfile Docker Image Dockerfile 52
  • 101. Recap: Challenges in Reproducibility > No standard way of describing experiments, environments, (derived) data, and workflows > No transparency in creating environments and the steps/methods to establish facts or recreate analysis
 
 > Experimental nature of research code and ecosystems makes it often hard to build > Unresolved or undocumented dependencies > Trusted infrastructure for storage and distribution Dockerfile Docker Image Docker Container Dockerfile 52
  • 102. Recap: Challenges in Reproducibility > No standard way of describing experiments, environments, (derived) data, and workflows > No transparency in creating environments and the steps/methods to establish facts or recreate analysis
 
 > Experimental nature of research code and ecosystems makes it often hard to build > Unresolved or undocumented dependencies > Trusted infrastructure for storage and distribution Dockerfile Docker Image Docker Container Registries (Docker Hub, Quay, …) Dockerfile 52
  • 103. ICWE 2016, Lugano Photo Credits: Astrid Westvang, https://flic.kr/p/pWJLCW Question Time! Jürgen Cito, Vincenzo Ferme, Harald C. Gall
  • 104. 54 Part III - Multi Containers Docker Application
 Preview Reproduce Bugs present in a Version of a CRUD Web Application 54 Redis NodeJS App MongoDB network
  • 105. 54 Part III - Multi Containers Docker Application
 Preview Reproduce Bugs present in a Version of a CRUD Web Application 54 Redis NodeJS App link MongoDB link network
  • 106. 54 Part III - Multi Containers Docker Application
 Preview Reproduce Bugs present in a Version of a CRUD Web Application 54 Redis NodeJS App link MongoDB link network Docker Compose
  • 107. ICWE 2016, Lugano Photo Credits: Astrid Westvang, https://flic.kr/p/pWJLCW End of Part II - Lunch Break! Jürgen Cito, Vincenzo Ferme, Harald C. Gall
  • 108. ICWE 2016, Lugano Photo Credits: Astrid Westvang, https://flic.kr/p/pWJLCW Part III - Industrial Case Study Jürgen Cito, Vincenzo Ferme, Harald C. Gall
  • 111. 57 What is Reproducibility? Single Container Docker Workflow # Build redis from source # Make sure you have the redis source code checked out in # the same directory as this Dockerfile FROM ubuntu:12.04 MAINTAINER dockerfiles http:// dockerfiles.github.io RUN echo "deb http://archive.ubuntu.com/ ubuntu precise main universe" > /etc/apt/ sources.list RUN apt-get update RUN apt-get upgrade -y RUN apt-get install -y gcc make g++ build- essential libc6-dev tcl wget RUN wget http://download.redis.io/redis- stable.tar.gz -O - | tar -xvz # RUN tar -zvzf /redis/redis-stable.tar.gz RUN (cd /redis-stable && make) RUN (cd /redis-stable && make test) RUN mkdir -p /redis-data VOLUME ["/redis-data"] EXPOSE 6379 ENTRYPOINT ["/redis-stable/src/redis- server"] CMD ["--dir", "/redis-data"] Dockerfile build Image Docker Image Docker Container run Challenges in Reproducibility
  • 112. 58 Multi Containers Docker Workflow # Build redis from source # Make sure you have the redis source code checked out in # the same directory as this Dockerfile FROM ubuntu:12.04 MAINTAINER dockerfiles http:// dockerfiles.github.io RUN echo "deb http://archive.ubuntu.com/ ubuntu precise main universe" > /etc/apt/ sources.list RUN apt-get update RUN apt-get upgrade -y RUN apt-get install -y gcc make g++ build- essential libc6-dev tcl wget RUN wget http://download.redis.io/redis- stable.tar.gz -O - | tar -xvz # RUN tar -zvzf /redis/redis-stable.tar.gz RUN (cd /redis-stable && make) RUN (cd /redis-stable && make test) RUN mkdir -p /redis-data VOLUME ["/redis-data"] EXPOSE 6379 ENTRYPOINT ["/redis-stable/src/redis- server"] CMD ["--dir", "/redis-data"] Dockerfile build Image Docker Image Docker Container 1 run
  • 113. 58 Multi Containers Docker Workflow Docker HubDocker Container 2 run # Build redis from source # Make sure you have the redis source code checked out in # the same directory as this Dockerfile FROM ubuntu:12.04 MAINTAINER dockerfiles http:// dockerfiles.github.io RUN echo "deb http://archive.ubuntu.com/ ubuntu precise main universe" > /etc/apt/ sources.list RUN apt-get update RUN apt-get upgrade -y RUN apt-get install -y gcc make g++ build- essential libc6-dev tcl wget RUN wget http://download.redis.io/redis- stable.tar.gz -O - | tar -xvz # RUN tar -zvzf /redis/redis-stable.tar.gz RUN (cd /redis-stable && make) RUN (cd /redis-stable && make test) RUN mkdir -p /redis-data VOLUME ["/redis-data"] EXPOSE 6379 ENTRYPOINT ["/redis-stable/src/redis- server"] CMD ["--dir", "/redis-data"] Dockerfile build Image Docker Image Docker Container 1 run
  • 114. network 58 Multi Containers Docker Workflow Docker HubDocker Container 2 run # Build redis from source # Make sure you have the redis source code checked out in # the same directory as this Dockerfile FROM ubuntu:12.04 MAINTAINER dockerfiles http:// dockerfiles.github.io RUN echo "deb http://archive.ubuntu.com/ ubuntu precise main universe" > /etc/apt/ sources.list RUN apt-get update RUN apt-get upgrade -y RUN apt-get install -y gcc make g++ build- essential libc6-dev tcl wget RUN wget http://download.redis.io/redis- stable.tar.gz -O - | tar -xvz # RUN tar -zvzf /redis/redis-stable.tar.gz RUN (cd /redis-stable && make) RUN (cd /redis-stable && make test) RUN mkdir -p /redis-data VOLUME ["/redis-data"] EXPOSE 6379 ENTRYPOINT ["/redis-stable/src/redis- server"] CMD ["--dir", "/redis-data"] Dockerfile build Image Docker Image Docker Container 1 run
  • 115. network 58 Multi Containers Docker Workflow Docker HubDocker Container 2 run link # Build redis from source # Make sure you have the redis source code checked out in # the same directory as this Dockerfile FROM ubuntu:12.04 MAINTAINER dockerfiles http:// dockerfiles.github.io RUN echo "deb http://archive.ubuntu.com/ ubuntu precise main universe" > /etc/apt/ sources.list RUN apt-get update RUN apt-get upgrade -y RUN apt-get install -y gcc make g++ build- essential libc6-dev tcl wget RUN wget http://download.redis.io/redis- stable.tar.gz -O - | tar -xvz # RUN tar -zvzf /redis/redis-stable.tar.gz RUN (cd /redis-stable && make) RUN (cd /redis-stable && make test) RUN mkdir -p /redis-data VOLUME ["/redis-data"] EXPOSE 6379 ENTRYPOINT ["/redis-stable/src/redis- server"] CMD ["--dir", "/redis-data"] Dockerfile build Image Docker Image Docker Container 1 run
  • 116. 59 Case Study 2: NodeJS + MongoDB + Redis Reproduce Bugs present in a Version of a CRUD Web Application Redis NodeJS App MongoDB network
  • 117. 59 Case Study 2: NodeJS + MongoDB + Redis Reproduce Bugs present in a Version of a CRUD Web Application Redis NodeJS App link MongoDB link network
  • 118. 60 Case Study 2: NodeJS + MongoDB + Redis Reproduce Bugs present in a Version of a CRUD Web Application Redis NodeJS App link MongoDB link network # Build redis from source # Make sure you have the redis source code checked out in # the same directory as this Dockerfile FROM ubuntu:12.04 MAINTAINER dockerfiles http:// dockerfiles.github.io RUN echo "deb http://archive.ubuntu.com/ ubuntu precise main universe" > /etc/apt/ sources.list RUN apt-get update RUN apt-get upgrade -y Web App
  • 119. 60 Case Study 2: NodeJS + MongoDB + Redis Reproduce Bugs present in a Version of a CRUD Web Application Redis NodeJS App link MongoDB link network # Build redis from source # Make sure you have the redis source code checked out in # the same directory as this Dockerfile FROM ubuntu:12.04 MAINTAINER dockerfiles http:// dockerfiles.github.io RUN echo "deb http://archive.ubuntu.com/ ubuntu precise main universe" > /etc/apt/ sources.list RUN apt-get update RUN apt-get upgrade -y Custom Schema and Data # Build redis from source # Make sure you have the redis source code checked out in # the same directory as this Dockerfile FROM ubuntu:12.04 MAINTAINER dockerfiles http:// dockerfiles.github.io RUN echo "deb http://archive.ubuntu.com/ ubuntu precise main universe" > /etc/apt/ sources.list RUN apt-get update RUN apt-get upgrade -y Web App
  • 120. 60 Case Study 2: NodeJS + MongoDB + Redis Reproduce Bugs present in a Version of a CRUD Web Application Redis NodeJS App link MongoDB link network # Build redis from source # Make sure you have the redis source code checked out in # the same directory as this Dockerfile FROM ubuntu:12.04 MAINTAINER dockerfiles http:// dockerfiles.github.io RUN echo "deb http://archive.ubuntu.com/ ubuntu precise main universe" > /etc/apt/ sources.list RUN apt-get update RUN apt-get upgrade -y Custom Schema and Data # Build redis from source # Make sure you have the redis source code checked out in # the same directory as this Dockerfile FROM ubuntu:12.04 MAINTAINER dockerfiles http:// dockerfiles.github.io RUN echo "deb http://archive.ubuntu.com/ ubuntu precise main universe" > /etc/apt/ sources.list RUN apt-get update RUN apt-get upgrade -y Web App
  • 122. 61 Docker Networks NETWORK ID NAME DRIVER bbd6e3c22dad bridge bridge d0bcac7befe4 host host a4f078c19762 none null docker network ls
  • 123. 61 Docker Networks docker network create icwe2016 Creates a bridge network named icwe2016 NETWORK ID NAME DRIVER bbd6e3c22dad bridge bridge d0bcac7befe4 host host a4f078c19762 none null docker network ls
  • 124. 61 Docker Networks docker network create icwe2016 Creates a bridge network named icwe2016 NETWORK ID NAME DRIVER bbd6e3c22dad bridge bridge d0bcac7befe4 host host a4f078c19762 none null docker network ls docker network create -d overlay icwe2016 Creates an overlay network named icwe2016
  • 126. 62 Docker Networks docker network create icwe2016 icwe2016
  • 127. 62 Docker Networks docker network create icwe2016 icwe2016 docker network connect icwe2016 NodeJSApp Connects NodeJSApp to the icwe2016 network icwe2016
  • 128. 62 Docker Networks docker network create icwe2016 icwe2016 docker network connect icwe2016 NodeJSApp Connects NodeJSApp to the icwe2016 network icwe2016 NodeJS App
  • 130. 63 Docker Networks icwe2016 NodeJS App docker run -d --net icwe2016 ... MongoDB Starts and connects MongoDB to the icwe2016 network https://docs.docker.com/engine/reference/commandline/network_create/ Many more possibilities for networks, see full reference here:
  • 131. 63 Docker Networks icwe2016 NodeJS App docker run -d --net icwe2016 ... MongoDB Starts and connects MongoDB to the icwe2016 network MongoDB https://docs.docker.com/engine/reference/commandline/network_create/ Many more possibilities for networks, see full reference here:
  • 132. 64 Docker Networks icwe2016 NodeJS App MongoDB EXPOSE 27017
  • 133. 64 Docker Networks icwe2016 NodeJS App MongoDB mongodb:27017 EXPOSE 27017 link
  • 134. 64 Docker Networks icwe2016 NodeJS App MongoDB mongodb:27017 EXPOSE 27017 link Docker takes care of: • adding the relevant reference to your container’s /etc/hosts • keeping the link valid across linked containers’ restarts
  • 135. 65 Case Study 2: NodeJS + MongoDB + Redis Reproduce Bugs present in a Version of a CRUD Web Application Redis NodeJS App link MongoDB link network # Build redis from source # Make sure you have the redis source code checked out in # the same directory as this Dockerfile FROM ubuntu:12.04 MAINTAINER dockerfiles http:// dockerfiles.github.io RUN echo "deb http://archive.ubuntu.com/ ubuntu precise main universe" > /etc/apt/ sources.list RUN apt-get update RUN apt-get upgrade -y Custom Schema and Data # Build redis from source # Make sure you have the redis source code checked out in # the same directory as this Dockerfile FROM ubuntu:12.04 MAINTAINER dockerfiles http:// dockerfiles.github.io RUN echo "deb http://archive.ubuntu.com/ ubuntu precise main universe" > /etc/apt/ sources.list RUN apt-get update RUN apt-get upgrade -y Web App
  • 136. 66 Case Study 2: NodeJS + MongoDB + Redis https://goo.gl/3h7DGA We paste the commands we run, live at the following url:
  • 137. 67 Case Study 2: Web Application https://github.com/scotch-io/node-todoRepo with the Application we have started from:
  • 138. 67 Case Study 2: Web Application https://github.com/scotch-io/node-todoRepo with the Application we have started from:
  • 139. 67 Case Study 2: Web Application https://github.com/scotch-io/node-todoRepo with the Application we have started from:
  • 140. 67 Case Study 2: Web Application https://github.com/scotch-io/node-todoRepo with the Application we have started from: + a couple of bugs, one client-side and one server-side
  • 141. 68 Case Study 2: NodeJS + MongoDB + Redis Redis NodeJS App link MongoDB link network # Build redis from source # Make sure you have the redis source code checked out in # the same directory as this Dockerfile FROM ubuntu:12.04 MAINTAINER dockerfiles http:// dockerfiles.github.io RUN echo "deb http://archive.ubuntu.com/ ubuntu precise main universe" > /etc/apt/ sources.list RUN apt-get update RUN apt-get upgrade -y Custom Schema and Data # Build redis from source # Make sure you have the redis source code checked out in # the same directory as this Dockerfile FROM ubuntu:12.04 MAINTAINER dockerfiles http:// dockerfiles.github.io RUN echo "deb http://archive.ubuntu.com/ ubuntu precise main universe" > /etc/apt/ sources.list RUN apt-get update RUN apt-get upgrade -y Web App
  • 142. 69 Case Study 2: NodeJS App Relevant files for Docker config/database.js config/redis.js bin/*
  • 143. 70 Case Study 2: NodeJS App (Simple) Dockerfile for NodeJS App FROM node:6.2.0 RUN mkdir -p /usr/src/app WORKDIR /usr/src/app COPY package.json /usr/src/app/ RUN npm install COPY . /usr/src/app COPY ./bin/wait-for-it.sh / RUN chmod +x /wait-for-it.sh COPY ./bin/wait-for-mongo-redis.sh / RUN chmod +x /wait-for-mongo-redis.sh EXPOSE 3000 ENTRYPOINT [ "/wait-for-mongo-redis.sh" ] CMD [ "npm", "start" ]
  • 144. 70 Case Study 2: NodeJS App (Simple) Dockerfile for NodeJS App FROM node:6.2.0 RUN mkdir -p /usr/src/app WORKDIR /usr/src/app COPY package.json /usr/src/app/ RUN npm install COPY . /usr/src/app COPY ./bin/wait-for-it.sh / RUN chmod +x /wait-for-it.sh COPY ./bin/wait-for-mongo-redis.sh / RUN chmod +x /wait-for-mongo-redis.sh EXPOSE 3000 ENTRYPOINT [ "/wait-for-mongo-redis.sh" ] CMD [ "npm", "start" ] Base Image
  • 145. 70 Case Study 2: NodeJS App (Simple) Dockerfile for NodeJS App FROM node:6.2.0 RUN mkdir -p /usr/src/app WORKDIR /usr/src/app COPY package.json /usr/src/app/ RUN npm install COPY . /usr/src/app COPY ./bin/wait-for-it.sh / RUN chmod +x /wait-for-it.sh COPY ./bin/wait-for-mongo-redis.sh / RUN chmod +x /wait-for-mongo-redis.sh EXPOSE 3000 ENTRYPOINT [ "/wait-for-mongo-redis.sh" ] CMD [ "npm", "start" ] App. Dir. Base Image
  • 146. 70 Case Study 2: NodeJS App (Simple) Dockerfile for NodeJS App FROM node:6.2.0 RUN mkdir -p /usr/src/app WORKDIR /usr/src/app COPY package.json /usr/src/app/ RUN npm install COPY . /usr/src/app COPY ./bin/wait-for-it.sh / RUN chmod +x /wait-for-it.sh COPY ./bin/wait-for-mongo-redis.sh / RUN chmod +x /wait-for-mongo-redis.sh EXPOSE 3000 ENTRYPOINT [ "/wait-for-mongo-redis.sh" ] CMD [ "npm", "start" ] App. Dir. Base Image Install Dependencies
  • 147. 70 Case Study 2: NodeJS App (Simple) Dockerfile for NodeJS App FROM node:6.2.0 RUN mkdir -p /usr/src/app WORKDIR /usr/src/app COPY package.json /usr/src/app/ RUN npm install COPY . /usr/src/app COPY ./bin/wait-for-it.sh / RUN chmod +x /wait-for-it.sh COPY ./bin/wait-for-mongo-redis.sh / RUN chmod +x /wait-for-mongo-redis.sh EXPOSE 3000 ENTRYPOINT [ "/wait-for-mongo-redis.sh" ] CMD [ "npm", "start" ] App. Dir. Base Image Install Dependencies Copy App.
  • 148. 70 Case Study 2: NodeJS App (Simple) Dockerfile for NodeJS App FROM node:6.2.0 RUN mkdir -p /usr/src/app WORKDIR /usr/src/app COPY package.json /usr/src/app/ RUN npm install COPY . /usr/src/app COPY ./bin/wait-for-it.sh / RUN chmod +x /wait-for-it.sh COPY ./bin/wait-for-mongo-redis.sh / RUN chmod +x /wait-for-mongo-redis.sh EXPOSE 3000 ENTRYPOINT [ "/wait-for-mongo-redis.sh" ] CMD [ "npm", "start" ] App. Dir. Base Image Install Dependencies Copy App. Utility Utility
  • 149. 70 Case Study 2: NodeJS App (Simple) Dockerfile for NodeJS App FROM node:6.2.0 RUN mkdir -p /usr/src/app WORKDIR /usr/src/app COPY package.json /usr/src/app/ RUN npm install COPY . /usr/src/app COPY ./bin/wait-for-it.sh / RUN chmod +x /wait-for-it.sh COPY ./bin/wait-for-mongo-redis.sh / RUN chmod +x /wait-for-mongo-redis.sh EXPOSE 3000 ENTRYPOINT [ "/wait-for-mongo-redis.sh" ] CMD [ "npm", "start" ] App. Dir. Base Image Install Dependencies Copy App. Private Port Utility Utility
  • 150. 70 Case Study 2: NodeJS App (Simple) Dockerfile for NodeJS App FROM node:6.2.0 RUN mkdir -p /usr/src/app WORKDIR /usr/src/app COPY package.json /usr/src/app/ RUN npm install COPY . /usr/src/app COPY ./bin/wait-for-it.sh / RUN chmod +x /wait-for-it.sh COPY ./bin/wait-for-mongo-redis.sh / RUN chmod +x /wait-for-mongo-redis.sh EXPOSE 3000 ENTRYPOINT [ "/wait-for-mongo-redis.sh" ] CMD [ "npm", "start" ] App. Dir. Base Image Install Dependencies Copy App. Enter Private Port Utility Utility
  • 151. 70 Case Study 2: NodeJS App (Simple) Dockerfile for NodeJS App FROM node:6.2.0 RUN mkdir -p /usr/src/app WORKDIR /usr/src/app COPY package.json /usr/src/app/ RUN npm install COPY . /usr/src/app COPY ./bin/wait-for-it.sh / RUN chmod +x /wait-for-it.sh COPY ./bin/wait-for-mongo-redis.sh / RUN chmod +x /wait-for-mongo-redis.sh EXPOSE 3000 ENTRYPOINT [ "/wait-for-mongo-redis.sh" ] CMD [ "npm", "start" ] App. Dir. Base Image Install Dependencies Copy App. Enter Start Private Port Utility Utility
  • 152. 71 Case Study 2: NodeJS App docker build -t icwe2016dockertutorial/ nodejsapp:master . Illustrative execution of Docker commands Context cd NodeJSApp
  • 153. 72 Case Study 2: NodeJS + MongoDB + Redis Redis NodeJS App link MongoDB link network # Build redis from source # Make sure you have the redis source code checked out in # the same directory as this Dockerfile FROM ubuntu:12.04 MAINTAINER dockerfiles http:// dockerfiles.github.io RUN echo "deb http://archive.ubuntu.com/ ubuntu precise main universe" > /etc/apt/ sources.list RUN apt-get update RUN apt-get upgrade -y Custom Schema and Data # Build redis from source # Make sure you have the redis source code checked out in # the same directory as this Dockerfile FROM ubuntu:12.04 MAINTAINER dockerfiles http:// dockerfiles.github.io RUN echo "deb http://archive.ubuntu.com/ ubuntu precise main universe" > /etc/apt/ sources.list RUN apt-get update RUN apt-get upgrade -y Web App
  • 154. 73 Case Study 2: MongoDB Relevant files for Docker data/* bin/*
  • 155. 74 Case Study 2: MongoDB (Simple) Dockerfile for MongoDB with Seed data FROM mongo:3.3.6 COPY data/seed/icwe2016dockertutorial /data/db/ icwe2016dockertutorial COPY bin/initialize-mongo.sh /initialize-mongo.sh RUN chmod +x /initialize-mongo.sh ENTRYPOINT ["/initialize-mongo.sh"] CMD ["mongod"]
  • 156. 74 Case Study 2: MongoDB (Simple) Dockerfile for MongoDB with Seed data FROM mongo:3.3.6 COPY data/seed/icwe2016dockertutorial /data/db/ icwe2016dockertutorial COPY bin/initialize-mongo.sh /initialize-mongo.sh RUN chmod +x /initialize-mongo.sh ENTRYPOINT ["/initialize-mongo.sh"] CMD ["mongod"] Base Image
  • 157. 74 Case Study 2: MongoDB (Simple) Dockerfile for MongoDB with Seed data FROM mongo:3.3.6 COPY data/seed/icwe2016dockertutorial /data/db/ icwe2016dockertutorial COPY bin/initialize-mongo.sh /initialize-mongo.sh RUN chmod +x /initialize-mongo.sh ENTRYPOINT ["/initialize-mongo.sh"] CMD ["mongod"] Base Image Defines also the private port
  • 158. 74 Case Study 2: MongoDB (Simple) Dockerfile for MongoDB with Seed data FROM mongo:3.3.6 COPY data/seed/icwe2016dockertutorial /data/db/ icwe2016dockertutorial COPY bin/initialize-mongo.sh /initialize-mongo.sh RUN chmod +x /initialize-mongo.sh ENTRYPOINT ["/initialize-mongo.sh"] CMD ["mongod"] Base Image Copy Data Defines also the private port
  • 159. 74 Case Study 2: MongoDB (Simple) Dockerfile for MongoDB with Seed data FROM mongo:3.3.6 COPY data/seed/icwe2016dockertutorial /data/db/ icwe2016dockertutorial COPY bin/initialize-mongo.sh /initialize-mongo.sh RUN chmod +x /initialize-mongo.sh ENTRYPOINT ["/initialize-mongo.sh"] CMD ["mongod"] Base Image Utility Copy Data Defines also the private port
  • 160. 74 Case Study 2: MongoDB (Simple) Dockerfile for MongoDB with Seed data FROM mongo:3.3.6 COPY data/seed/icwe2016dockertutorial /data/db/ icwe2016dockertutorial COPY bin/initialize-mongo.sh /initialize-mongo.sh RUN chmod +x /initialize-mongo.sh ENTRYPOINT ["/initialize-mongo.sh"] CMD ["mongod"] Base Image Utility Copy Data Enter Defines also the private port
  • 161. 74 Case Study 2: MongoDB (Simple) Dockerfile for MongoDB with Seed data FROM mongo:3.3.6 COPY data/seed/icwe2016dockertutorial /data/db/ icwe2016dockertutorial COPY bin/initialize-mongo.sh /initialize-mongo.sh RUN chmod +x /initialize-mongo.sh ENTRYPOINT ["/initialize-mongo.sh"] CMD ["mongod"] Base Image Utility Copy Data Enter Start Defines also the private port
  • 162. 75 Case Study 2: MongoDB docker build -t icwe2016dockertutorial/ mongodb:master . Illustrative execution of Docker commands Context cd MongoDB
  • 163. 76 Case Study 2: NodeJS + MongoDB + Redis Redis NodeJS App link MongoDB link network # Build redis from source # Make sure you have the redis source code checked out in # the same directory as this Dockerfile FROM ubuntu:12.04 MAINTAINER dockerfiles http:// dockerfiles.github.io RUN echo "deb http://archive.ubuntu.com/ ubuntu precise main universe" > /etc/apt/ sources.list RUN apt-get update RUN apt-get upgrade -y Custom Schema and Data # Build redis from source # Make sure you have the redis source code checked out in # the same directory as this Dockerfile FROM ubuntu:12.04 MAINTAINER dockerfiles http:// dockerfiles.github.io RUN echo "deb http://archive.ubuntu.com/ ubuntu precise main universe" > /etc/apt/ sources.list RUN apt-get update RUN apt-get upgrade -y Web App
  • 164. Illustrative execution of Docker commands 77 Case Study 2: Redis docker pull redis:3.2.0-alpine
  • 165. 78 Case Study 2: Starting the NodeJS App docker run -d --net icwe2016 --name mongodb icwe2016dockertutorial/mongodb:masterdocker docker network create icwe2016 docker run -d --net icwe2016 --name redis redis:3.2.0-alpine docker run -d --net icwe2016 -p 8080:3000 --name nodejsapp icwe2016dockertutorial/nodejsapp:master Illustrative execution of Docker commands
  • 166. 79 Case Study 2: Connect to the NodeJs App
  • 167. 79 Case Study 2: Connect to the NodeJs App
  • 168. 79 Case Study 2: Connect to the NodeJs App docker-machine ls Illustrative execution of Docker commands
  • 169. 79 Case Study 2: Connect to the NodeJs App docker-machine ls Illustrative execution of Docker commands Better solution (in Beta): https://beta.docker.com
  • 170. 80 Case Study 2: Server-side Fix (live) docker exec -ti nodejsapp bash Illustrative execution of commands Context app/routes.js Bug: the App. creates the same item twice docker restart nodejsapp apt-get update && apt-get install -y vim vim routers.js exit
  • 171. 81 Docker in Continuous Integration and Delivery Live Fix CI CD + +
  • 172. 81 Docker in Continuous Integration and Delivery Local Build Image Live Fix CI CD + +
  • 173. 81 Docker in Continuous Integration and Delivery Local Build Image Live Fix CI CD + + Docker Hub Build
  • 174. Push 81 Docker in Continuous Integration and Delivery Local Build Image Live Fix CI CD + + Docker Hub Build
  • 175. Push 81 Docker in Continuous Integration and Delivery Local Build Image Live Fix CI CD + + Docker Hub Build
  • 176. 82 Case Study 2: Client-side Fix (new build) docker build -t icwe2016dockertutorial/ nodejsapp:master . Illustrative execution of commands (cd NodeJSApp) Context public/js/controllers/main.js Bug: the App. creates empty todos docker run -d --net icwe2016 -p 8080:3000 --name nodejsapp icwe2016dockertutorial/nodejsapp:master docker rm -f -v nodejsapp
  • 177. 83 Case Study 2: Undeploy the App docker rm -f —v mongodb redis nodejsapp Illustrative execution of Docker commands
  • 178. 84 Case Study 2: A Better Way of Starting the NodeJS App Docker Compose
  • 179. 85 Docker Compose A tool for defining and running multi-container Docker applications version: '2' build: services: mongodb: ... redis: ... nodejsapp: ... networks: icwe2016: driver: bridge volumes:
  • 180. 85 Docker Compose A tool for defining and running multi-container Docker applications version: '2' build: services: mongodb: ... redis: ... nodejsapp: ... networks: icwe2016: driver: bridge volumes: Build settings
  • 181. 85 Docker Compose A tool for defining and running multi-container Docker applications version: '2' build: services: mongodb: ... redis: ... nodejsapp: ... networks: icwe2016: driver: bridge volumes: Build settings Services’ deployment settings
  • 182. 85 Docker Compose A tool for defining and running multi-container Docker applications version: '2' build: services: mongodb: ... redis: ... nodejsapp: ... networks: icwe2016: driver: bridge volumes: Build settings Services’ deployment settings Networks’ settings
  • 183. 85 Docker Compose A tool for defining and running multi-container Docker applications version: '2' build: services: mongodb: ... redis: ... nodejsapp: ... networks: icwe2016: driver: bridge volumes: Build settings Services’ deployment settings Networks’ settings Volumes’ settings
  • 184. 86 Docker Compose A tool for defining and running multi-container Docker applications docker-compose up -d docker-compose start MongoDB docker-compose logs https://docs.docker.com/compose/reference/ Many more possibilities, see full reference here:
  • 185. 86 Docker Compose A tool for defining and running multi-container Docker applications docker-compose up -d Starts the services and detaches from the command docker-compose start MongoDB docker-compose logs https://docs.docker.com/compose/reference/ Many more possibilities, see full reference here:
  • 186. 86 Docker Compose A tool for defining and running multi-container Docker applications docker-compose up -d Starts the services and detaches from the command docker-compose start MongoDB Starts the MongoDB service docker-compose logs https://docs.docker.com/compose/reference/ Many more possibilities, see full reference here:
  • 187. 86 Docker Compose A tool for defining and running multi-container Docker applications docker-compose up -d Starts the services and detaches from the command docker-compose start MongoDB Starts the MongoDB service docker-compose logs Shows the aggregated logs from all the services https://docs.docker.com/compose/reference/ Many more possibilities, see full reference here:
  • 188. 87 Case Study 2: Docker Compose File (1/4) version: '2' services: mongodb: ... redis: ... nodejsapp: ... networks: icwe2016: driver: bridge Context cd NodeJSApp
  • 189. 87 Case Study 2: Docker Compose File (1/4) version: '2' services: mongodb: ... redis: ... nodejsapp: ... networks: icwe2016: driver: bridge Services’ deployment settings Context cd NodeJSApp
  • 190. 87 Case Study 2: Docker Compose File (1/4) version: '2' services: mongodb: ... redis: ... nodejsapp: ... networks: icwe2016: driver: bridge Services’ deployment settings Networks’ settings Context cd NodeJSApp
  • 191. 88 Case Study 2: Docker Compose File (2/4) services: mongodb: image: icwe2016dockertutorial/mongodb:master container_name: mongodb # make it explicit the ports exposed by the Dockefile expose: - 27017 # make it explicit the volumes exposed by the Dockerfile volumes: - /data/db - /data/configdb networks: - icwe2016
  • 192. 89 Case Study 2: Docker Compose File (3/4) redis: image: redis:3.2.0-alpine container_name: redis # make it explicit the ports exposed by the Dockefile expose: - 6379 # make it explicit the volumes exposed by the Dockerfile volumes: - /data networks: - icwe2016
  • 193. 90 Case Study 2: Docker Compose File (4/4) nodejsapp: image: icwe2016dockertutorial/nodejsapp:master container_name: nodejsapp # make it explicit the ports exposed by the Dockefile expose: - 3000 depends_on: - mongodb - redis ports: - "8080:3000" networks: - icwe2016
  • 194. 91 Case Study 2: Starting the NodeJS App with Docker Compose docker-compose up -d Starts the services and detaches from the command docker-compose logs -f Shows and follows the aggregated logs from all the services Illustrative execution of Docker commands Context cd NodeJSApp
  • 196. 92 Recap: Multi Containers Deployment > There are many images on the Docker Hub which we can reuse
  • 197. 92 Recap: Multi Containers Deployment > There are many images on the Docker Hub which we can reuse > Docker simplifies the reproducibility of bugs because we can always refer to the image built for a specific version
  • 198. 92 Recap: Multi Containers Deployment > There are many images on the Docker Hub which we can reuse > Docker simplifies the reproducibility of bugs because we can always refer to the image built for a specific version > Docker speeds up the debugging of applications composed of many services
  • 199. 92 Recap: Multi Containers Deployment > There are many images on the Docker Hub which we can reuse > Docker simplifies the reproducibility of bugs because we can always refer to the image built for a specific version > Docker speeds up the debugging of applications composed of many services > Docker provides network abstraction for portable deployments of multi container services
  • 200. 92 Recap: Multi Containers Deployment > There are many images on the Docker Hub which we can reuse > Docker simplifies the reproducibility of bugs because we can always refer to the image built for a specific version > Docker speeds up the debugging of applications composed of many services > Docker provides network abstraction for portable deployments of multi container services > Docker Compose enables portable deployment descriptors
  • 201. ICWE 2016, Lugano Photo Credits: Astrid Westvang, https://flic.kr/p/pWJLCW End of Part III - Summary Time! Jürgen Cito, Vincenzo Ferme, Harald C. Gall
  • 202. 94 Steps for Reproducibility A recipe for enhancing reproducibility with Docker
  • 203. 94 Steps for Reproducibility A recipe for enhancing reproducibility with Docker > Provide the source code (documented) on a public repository
  • 204. 94 Steps for Reproducibility A recipe for enhancing reproducibility with Docker > Provide the source code (documented) on a public repository > Release the Dockerfiles using version pinning
  • 205. 94 Steps for Reproducibility A recipe for enhancing reproducibility with Docker > Provide the source code (documented) on a public repository > Release the Dockerfiles using version pinning > Setup an automated/trusted build on the Docker Hub
  • 206. 94 Steps for Reproducibility A recipe for enhancing reproducibility with Docker > Provide the source code (documented) on a public repository > Release the Dockerfiles using version pinning > Setup an automated/trusted build on the Docker Hub > Provide portable deployment descriptors using Docker Compose
  • 207. 95 Steps for Reproducibility Additional useful services > DOI for Source Code and Docker Images: • Citable Code
 https://guides.github.com/activities/citable-code/
  • 208. 95 Steps for Reproducibility Additional useful services > DOI for Source Code and Docker Images: • Citable Code
 https://guides.github.com/activities/citable-code/ • Citable Docker Images
 http://www.software.ac.uk/blog/2016-03-29-reproducible-research-citing- your-execution-environment-using-docker-and-doi
  • 210. 96 Docker’s Limitations > Not enough for performance experiments 
 [Jimenez et al., The Role of Container Technology in Reproducible Computer Systems Research]
  • 211. 96 Docker’s Limitations > Not enough for performance experiments 
 [Jimenez et al., The Role of Container Technology in Reproducible Computer Systems Research] > Not enough for data-intensive workload
 [http://ivory.idyll.org/blog/2015-docker-and-replicating-papers.html, data on http://www.zenodo.org]
  • 212. 96 Docker’s Limitations > Not enough for performance experiments 
 [Jimenez et al., The Role of Container Technology in Reproducible Computer Systems Research] > Not enough for data-intensive workload
 [http://ivory.idyll.org/blog/2015-docker-and-replicating-papers.html, data on http://www.zenodo.org] > Limits with proprietary software and dependencies
  • 213. 96 Docker’s Limitations > Not enough for performance experiments 
 [Jimenez et al., The Role of Container Technology in Reproducible Computer Systems Research] > Not enough for data-intensive workload
 [http://ivory.idyll.org/blog/2015-docker-and-replicating-papers.html, data on http://www.zenodo.org] > Limits with proprietary software and dependencies > Non-Disclosure Agreements / Intellectual Property
  • 214. 96 Docker’s Limitations > Not enough for performance experiments 
 [Jimenez et al., The Role of Container Technology in Reproducible Computer Systems Research] > Not enough for data-intensive workload
 [http://ivory.idyll.org/blog/2015-docker-and-replicating-papers.html, data on http://www.zenodo.org] > Limits with proprietary software and dependencies > Non-Disclosure Agreements / Intellectual Property > Can we build the same artifact from the specification (Dockerfile) even in 10 years? [Suggestion: Version Pinning]
  • 215. Sum up and Conclusion > Containers enable a standard, fast, and easy way of describing experiments and environments > Containers help your future self, reviewers, and other researchers and colleagues to make use and improve your work
  • 216. 98 Further Reading > Docker for beginners: 
 http://prakhar.me/docker-curriculum/ > Docker Hands-on: 
 https://github.com/alexellis/HandsOnDocker/blob/master/Labs.md > Experience in using Docker for reproducible research: 
 http://melissagymrek.com/science/2014/08/29/docker-reproducible-research.html > Multi-host networking with Docker: 
 https://docs.docker.com/engine/userguide/networking/get-started-overlay/
  • 217. ICWE 2016, Lugano Photo Credits: Astrid Westvang, https://flic.kr/p/pWJLCW Question Time! Jürgen Cito, Vincenzo Ferme, Harald C. Gall
  • 218. Material: https://github.com/ICWE2016DockerTutorial
 https://hub.docker.com/u/icwe2016dockertutorial/ Speakers References + Slides + Material Slides: http://icwe2016.inf.usi.ch/program/tutorials/docker Vincenzo Ferme PhD @ USI fermev@usi.ch @VincenzoFerme Jürgen Cito PhD @ UZH cito@ifi.uzh.ch @citostyle