This document discusses Docker, including what it is, why it is useful, and how it can be used at different stages of development and deployment. Docker allows packaging applications and dependencies into standardized containers that can run on any infrastructure. It helps manage different environments, platforms and targets. The document outlines Docker tools like Docker Engine, Docker Compose, Docker Machine and Swarm that can be used for local development, CI/testing, and production deployment of containerized applications.
2. Agenda
What is docker and why use it
The basic docker tools
Docker during development
Docker during CI and testing
Docker in production
Q & A
3. Not on the agenda
How do docker or linux containers actually work
4. What is Docker?
“Docker allows you to package an application with all of its dependencies into a standardized unit for
software development.”
5. What is Docker?
Docker is an opinioned implementation for building, shipping and deploying applications as
standalone containers.
6. What are docker containers?
Docker containers are a Linux technology!
9. Why?
Languages
.NET, NodeJS, Java,
Python. Go, …
Applications
Web Services,
Background Workers,
Databases, …
Libraries
.NET Framework,
ExpressJS, Django, Ruby
On Rails, …
Modern architectures have a diverse
ecosystem.
More sources to handle.
16. Linux Containers
Distro and vendor neutral environment for
the development of Linux container
technologies.
LXC, LXD, …
https://linuxcontainers.org/
17. Alternatives to Docker
Linux Containers
https://linuxcontainers.org/
Flockport
https://www.flockport.com/
Rocket (CoreOS)
https://github.com/coreos/rkt
Drawbridge (Microsoft)
http://research.microsoft.com/en-us/projects/drawbridge/
LXD (Ubuntu/OpenStack)
http://www.ubuntu.com/cloud/lxd
Windows Containers
https://msdn.microsoft.com/en-
us/virtualization/windowscontainers/quick_start/manage_docker?f=255&MSPPError=-2147217396
18. Even Microsoft joins in
https://azure.microsoft.com/en-us/blog/new-windows-server-containers-and-azure-support-for-
docker/
https://azure.microsoft.com/en-us/blog/containers-docker-windows-and-trends/
https://msdn.microsoft.com/en-
us/virtualization/windowscontainers/quick_start/manage_docker?f=255&MSPPError=-2147217396
25. docker-compose
Docker Compose allows you to define
your multi-container application with all of
its dependencies in a single file, then spin
your application up in a single command.
27. swarm
Docker Swarm provides native clustering
capabilities to turn a group of Docker
engines into a single, virtual Docker
Engine.
28. swarm
Can run as a container on a docker engine
instance.
docker run swarm
29. Using Docker in development
Docker in the development part of Application Lifecycle Management
30. Development
FROM node
MAINTAINER Stefan Alaerts <stefan.alaerts@narato.be>
RUN apt-get update -qq && apt-get install -y build-essential
RUN mkdir /eventhandler-api-service
COPY . /eventhandler-api-service/
WORKDIR /eventhandler-api-service
ENV NODE_ENV production
RUN npm install
EXPOSE 8888
CMD node lib/index.js
Use a Dockerfile to describe how docker
should build an image for your
application.
The resulting image should preferably be
self-contained.
35. Tips for Windows users
Don’t suspend your computer while docker-machine is running a
machine in VirtualBox.
Doing so often breaks networking.
36. Tips for Windows users
When using volumes, make sure your project folder is inside your
user home directory. (VirtualBox shared folders limitation.)
37. Tips for Linux users
Use the power of the command line to remove all images with one
command:
docker rm `docker ps -aq`
38. Tips for all users
Use the docker-compose extends functionality.
You can auto-reload your application in development by sharing your
code using volumes while embedding the code in production.
Most production tools (Docker Cloud, Rancher, …) also support
extending compose configurations.
39. Tips for all users
You can access the shell of a running container if you need it.
docker exec –i –t [container_id|container_name] bash
40. Using Docker after development
Docker in the CI and testing part of Application Lifecycle Management
47. Example: deploying a NodeJS blog
git push origin master
Docker Hub kicks off an automated build on each push
Editor's Notes
Solomon Hykes started Docker in France as an internal project within dotCloud, a platform-as-a-service company,[36] with initial contributions by other dotCloud engineers including Andrea Luzzardi and Francois-Xavier Bourlet. Jeff Lindsay also became involved as an independent collaborator. Docker represents an evolution of dotCloud's proprietary technology, which is itself built on earlier open-source projects such as Cloudlets.
Docker was released as open source in March 2013.[13] On March 13, 2014, with the release of version 0.9, Docker dropped LXC as the default execution environment and replaced it with its own libcontainer library written in the Go programming language.[9][14] As of October 24, 2015[update], the project had over 25,600 GitHub stars (making it the 20th most-starred GitHub project), over 6,800 forks, and nearly 1,100 contributors.[37]
Solomon Hykes started Docker in France as an internal project within dotCloud, a platform-as-a-service company,[36] with initial contributions by other dotCloud engineers including Andrea Luzzardi and Francois-Xavier Bourlet. Jeff Lindsay also became involved as an independent collaborator. Docker represents an evolution of dotCloud's proprietary technology, which is itself built on earlier open-source projects such as Cloudlets.
Docker was released as open source in March 2013.[13] On March 13, 2014, with the release of version 0.9, Docker dropped LXC as the default execution environment and replaced it with its own libcontainer library written in the Go programming language.[9][14] As of October 24, 2015[update], the project had over 25,600 GitHub stars (making it the 20th most-starred GitHub project), over 6,800 forks, and nearly 1,100 contributors.[37]
Difference with compose: swarm operates across multiple docker engine instances, compose scales services within a docker engine instance,