Docker in a nutshell
[Link]
[Link]
[Link]
1
Agenda
● What is Docker?
● Advantage over classical virtualization
● How to install Docker
● Exercise: How to use Docker
[Link]
Copyright © 2016 Open Geospatial Consortium
What is Docker?
● Docker allows to package an application into a
standardized unit for software development:
– The Docker Container
● A Docker Container wraps a
piece of software in a complete
filesystem which contains all
needed resources
● A Docker Container runs
on Linux, Windows, macOS,
and most Cloud infrastructures Image source: [Link]
[Link]
Copyright © 2016 Open Geospatial Consortium
Docker promise: Build, Ship, Run!
● Docker enables reliable deployments
– Build here, run there
[Link]
Advantage over classical virtualization
● Setting up a Virtual Machine requires additional tools for
provisioning such as Puppet, Chef, Ansible, Vagrant, shell scripts
and more ...
– Tools such as Packer do support builder and provisioners
● But ...
– Docker comes with template Docker images hosted at
[Link]
– Easy to extend with custom software, libraries, files defined in
a single Dockerfile
– Images are version controlled and lightweight
– Supports the Dev&Ops paradigm Infrastructure-as-Code
[Link]
Copyright © 2016 Open Geospatial Consortium
Exercise: How to install Docker
● There are official installation guides available for
various operating systems.
– [Link]
● As installation guides are self-explanatory and
Docker is pre-installed on all working stations, we can
skip to the next chapter.
[Link]
Exercise: How to use Docker
● Check if correct Docker version is installed:
docker version
● Run first Docker container:
docker run hello-world
● First, Docker Image is searched locally, when not found
● Then, Docker Image is pulled from DockerHub.
● Split up command:
docker pull hello-world
docker run hello-world
[Link]
Exercise: How to use Docker
● States of a Docker application:
– Dockerfile
● Configuration to create a Docker Image.
– Docker Image
● Image can be loaded by Docker and is used to create
Docker Container.
– Docker Container
● Instance of a Docker Image.
● Dockerfile Dockerfile is
located here!
– Build a Docker Image from Dockerfile with:
docker build -t username/imagename .
[Link]
Exercise: How to use Docker
● Docker Image
– List all Docker Images:
docker images
– Remove Docker Image with name 'imagename':
docker rmi imagename
● Docker Container
– List all Docker Containers with size:
docker ps -as
– Remove Docker Container 'containername':
docker rm containername
[Link]
Exercise: How to use Docker
● Remove the Docker Container and Docker Image of the
hello-world application.
● Then pull the image (with the pull command) and run it
again.
[Link]
Exercise: How to use Docker
● Other useful Docker commands:
– docker create imagename
– docker start containername
– docker stop containername
– docker restart containername
– docker kill containername
● The „httpd“ Docker Image can be used to test above
documented commands.
[Link]
What we have learned
● Your are familiar with basic usage and commands of
Docker.
[Link]
Contact & Licence
© 2017 lat/lon
gesellschaft für raumbezogene
informationssysteme mbH
Aennchenstrasse 19
53177 Bonn
Tel: +49 +228 18496-0
Fax: +49 +228 18496-29
info@[Link]
[Link]
[Link]
13