You are on page 1of 1

Table of Contents

Docker Introduction ...................................................................................................................................1


Namespacing: ........................................................................................................................................1
Types of Namespaces .......................................................................................................................2
Control Group (cgroup).........................................................................................................................2
$docker info command ..............................................................................................................................3
Quick glance at docker image:...................................................................................................................3
Docker Container commands.....................................................................................................................4
Docker image commands.........................................................................................................................10
Creating new image: ................................................................................................................................11
Most useful commands in Dockerfile .................................................................................................13
ARG and ENV Availability............................................................................................................16
Multi-step image .................................................................................................................................16
Shell and Exec Form ...........................................................................................................................17
Docker network:.......................................................................................................................................17
Docker compose: .....................................................................................................................................18
The Dot-Env File (.env) ......................................................................................................................21
Setting ARG Values in docker-compose .............................................................................................21
Different ways to set environment variables ...........................................................................................22
1. Provide values one by one ..........................................................................................................22
2. Pass environment variable values from your host......................................................................22
3. Take values from a file (env_file) ..............................................................................................23
Restart policies (--restart) ........................................................................................................................24

Docker Vs VM
1. Docker image is smaller. Docker size is in megabytes vs VM size is typically in Gigabyte
2. Docker containers starts and run much faster.
3. VM of any OS can run on any OS host
4. Docker uses Host OS kernal vs VM uses its own kernal on top of host OS.
5. Docker uses operating system level virtualization as it uses host sytem to talk to kernal and
hardware.
6. VMs are hardware level virtualization as it brigs its own kernal to talk to the harware.
7. In docker we do process isolation.

You might also like