Containerization involves bundling an application together with all of its related configuration files, libraries and dependencies required for it to run in an efficient and bug-free way across different computing environments.
Docker is containerization technology which uses the Linux Kernel features to create containers on top of an operating system and automates application deployment on the container. Containers can be thought of as extremely lightweight, modular virtual machines. Docker is a platform to build, run, and share applications with containers.
Docker Image: An image includes everything needed to run an application - the code or binary, runtimes, dependencies, and any other filesystem objects required.
Docker Container: A container is nothing but a running process, with some added encapsulation features applied to it in order to keep it isolated from the host and from other containers.
sudo apt-get remove docker docker-engine docker.io containerd runc docker*
sudo apt-get update
sudo apt-get -y install
apt-transport-https
ca-certificates
curl
gnupg-agent
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository
"deb [arch=amd64] https://download.docker.com/linux/ubuntu
$(lsb_release -cs)
stable"
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose
sudo usermod -aG docker $USER
Log in and logout current user to avoid using docker commands with sudo
sudo systemctl enable docker
sudo systemctl start docker
sudo docker run hello-world
Next: Docker Cheatsheet