4. Why do we need this?
Complex systems development
Deploying on test/prod. servers, developer machines
Different target OS
Different software versions
Etc
8. What is Docker?
Open-source engine that automates the deployment of
applications into containers developed by Docker Inc
Based on:
libcontainer - container format
namespaces - isolation
cgroups - sharing
unionfs - layering
10. Requirements
Linux kernel with cgroups and namespaces features
x86_64 & amd64 only
appropriate storage driver
− dev mapper
− AUFS
− vfs
− btrfs
11. Hello world
sudo docker run -i -t ubuntu /bin/bash
sudo - you have to run all docker commands as
root
run - start container
-i - keeps STDIN open
-t - assign pseudo-TTY
ubuntu - image
/bin/bash - command (CMD)
14. Images & Containers
write CONTAINER GOES HERE
read only curl example.com 701e38299831
read only ... 5171cea75fa4
read only apt-get install curl cc0f88ebb125
read only apt-get update b9474e097082
read only base image 447ff49a67a0
15. Life cycle
Image:
build
− do some action
− create intermediate image
create a container
remove
Container:
start
mount volumes
expose ports
run service
remove
18. Best practices
Include only necessary context
Use a .dockerignore file
Avoid installing unnecessary packages
Use cache
Be care with volumes
Use environment varaibles (in RUN, EXPOSE, VOLUME)
27. Docker true way
1 application = 1 container
Run process in foreground
Keep data out of container
No SSH
No manual configurations (or actions) inside container
30. Usefull docs
Official documentation https://docs.docker.com/
Docker blog http://blog.docker.com/
Docker Hub https://registry.hub.docker.com/
The Docker Book