21 - DOCKER Flashcards
How do we isolate services
Install applications on different virtual servers
Why we isolate services
To archieve high availability
High performance
cons of VM
o Expenditure
o Compute resources
what is a container
A standard unit of software that packages up code, dependencies for development, shipment and deployment
container vs VM
Container offer isolation not virtualization
Containers are OS virtualization
VM’s are hardware virtualization
VM’s needs OS
Containers don’t need OS
Containers uses host OS for compute resource
what is docker
Docker is a container runtime environment, manages containers
advantages of docker
Standard and portable
Lightweight
secure
docker installation and setup on linux VM
add user to docker group
sudo vim /etc/group
docker: x :999:ubuntu
$ usermod -aG ubuntu
enable docker start on boot
sudo systemctl enable docker
Install hello-world image
docker run hello-world
what is dockerhub
Registry for docker images
describe a docker image
o A stopped container like vm image
o Consist of multiple layers
o An app will be bundled in an image
o Containers run from images
o Images are called repositories in registries
popular docker registries
ECR, GCR, dockerhub
command to create/run a container
docker run [image-name]
command to view docker images locally
docker images
Get image locally
docker pull image_name
run container with name in detached mode
docker run –name myweb -d nginx -p [host port]: [container port]
list running containers
docker ps