Docker Installation
- For Guided creation of ec2 instance watch classroom recording
- Docker installation
- Simplest
bash
curl -fsSL https://get.docker.com -o install-docker.sh
sh install-docker.sh - NOw add the current user to docker group
“`
</ul>
<h1>sudo usermod -aG docker $USER</h1>
sudo usermod -aG docker ubuntu
“` - Simplest
- When we install docker the following components will be installed
- docker ce (docker daemon)
- docker ce cli (docker client)
- containerd
- docker compose
- docker buildx
Docker Package based installation
- Refer Here for ubuntu steps
Docker Images
- Docker images have tags which represent versions. If you don’t pass tag, docker will assume it to be latest
docker pull nginx
- Docker images from docker hub
- official images
<application>:<tag> - community images
organization/application:tag - private images
<username>/application:tag
- official images
Docker container creation modes
- Attached/Foreground

- Detached

- interactive termninal: you want to get into shell while creating container

Execution in running contianers
- Docker has a command called as
exec

- We can use exec to run a command inside container
- we can also use exec in an interactive way
docker container exec -it nginx2 /bin/bash

Observations:
- Inside containers, the PID 1 is the application startup
- Container will have its own process tree
- Contianer will have its own network, diskmounts, CPU and RAM allocated
- Restrictions can be placed on RAM and CPU
- Inside containers we have its own set of users
