a containerisation platform which package our application and all its
dependencies together in form of containers to ensure that our application
works seamlessly in any environment be it Development, Test or Production.
Docker is not just another stack in virtual machine (VM) concept. To relate containerisation is just virtualisation at the OS level.
Taken from some online tutorial.
Containers on same OS kernel are lighter & smaller.
Containerisation brings process level isolation.
Better resource Utilisation compared to VM.
Short Boot-up process (1/20th of a second).
VM Vs Docker at glance:-
Communication happens between docker client & Docker Daemon by combination of REST API, Socket.IO and TCP.
It run on host Machine.
It creates and manages dockers object such as images, containers, Networks, Data, Volumes etc.
User does not directly interact with the docker client.
Primary user interface to docker.
It accepts commands from the users and communicates back and forth with dockers daemon.
Images are used to create docker containers.
Dockers provides a simple way to build new images or update existing images,
Docker images are the 'Build' component of dockers.
Registries store images.
These are public or private stored from which we upload/downloads images.
This can be done on docker hub(which is docker version of GITHUB)
Docker Registry are 'distribution' component of docker.
Containers are created from docker images.
It holds everything needed for an application to run.
Each containers is an isolated and secure application platform.
Docker containers are the 'run' components of docker.
It has following component:
build--- pull --- distribute --- run
Handy Docker commands on the GO:
To pull a docker images from docker hub
$ docker pull <image-name:tag>
To run an images
$ docker run<image-name:tag> OR
$ docker run <image-id>
To Build an image
$ docker build -t <image-name>:tag
To run newly built image
$ docker run --name "container name" -p <host-port>:<container-port><image-name:tag>
To list down images on our system
$ docker images
To list down all the running containers
$ docker ps
To list down all the containers (even if they are not running)
$ docker ps -a
To start the containers
$ docker start <container id>
To stop the container
$ docker stop <container id>
To delete the container [This command should be used after container is stopped]
$ docker rm <container name>
To delete image
$ docker rmi <image id> OR
$ docker rmi <repo:tag>
The blog has been written after reading and watching online materials on dockers.