Docker

- 1 min

328 Lecture

Docker

OS level virtualization

OS allows one or more isolated user space instances —> containers

image

Containers are isolated from one another and bundle their own software. image

Overall picture of the docker workflow

image

Docker hub —> standard repo / registry

Pros and Cons

Low resources

faster startup

Less traditional

image

sudo apt update
sudo apt intall docker 

For testing

https://labs.play-with-docker.com/

https://hub.docker.com/

Verify Installation

Run Docker

docker info
docker ps

Getting started

Create dockerfile

text documetn containing commands to assemble custom docker image

Generate Docker image (docker build)

Execute the Image

Running an instance of the image

Port Binding

Default docker containers make connections to the outside world but the outside world cannot connect to containers

Attatched and Detached Mode

If you want to see all the output of the container, you can use default attach mode

can’t execute any commands , if terminal is attatched with the container

Press(Ctrl+c ) to exit the container

Detached mode

Can run commands if terminal is detached with container