Rensselaer Center for Open Source
By: Seve, Joey, and Andy
Tech Talk: Docker Basics
What is Docker?
What is Docker?
Docker is an open-source project that automates the deployment of applications inside software containers... by providing an additional layer of abstraction and automation of operating-system-level virtualization on Linux.
Technical Details
Why
What
Why Developers Care
VMs vs Containers
Why are Docker Containers Lightweight?
Container vs Image
Image
An image is an inert snapshot of a container.
When run (with a docker run command) it becomes a container.
As images can be quite heavy they are designed to be composed of layers of other images which allows them to minimize the image weight, and those layers can be reused between images.
Images are stored (mainly) on Docker Hub.
Container vs Image
Image
An image is built from a Dockerfile. A file describing how the image is supposed to behave, what it extends from, ...
docker images command lists all local images :
Container vs Image
Container
Programmatically speaking, if an image is a class, then a container would be an instance of this class.
So, you can launch multiple containers for the same image (multiple instances).
docker ps command lists all running containers :
Demo
Time to test out Docker!
Orchestration
Solutions?
What if we want to run multiple containers at once
Orchestration
Docker compose works by putting a single yaml file in your project.
Docker compose works by putting a single yaml file in your project