Docker

Docker tutorial – how to install Docker on Ubuntu

Pinterest LinkedIn Tumblr

What is Docker?

Docker is an open-source project that automates the deployment of applications inside software containers. These application containers are similar to lightweight virtual machines, as they can be run in isolation to each other and the running host.

In simpler words, Docker is a tool that allows developers, sys-admins etc. to easily deploy their applications in a sandbox (called containers) to run on the host operating system i.e. Linux. The key benefit of Docker is that it allows users to package an application with all of its dependencies into a standardized unit for software development. Unlike virtual machines, containers do not have high overhead and hence enable more efficient usage of the underlying system and resources.

What are containers?

Containers are a form of operating system virtualization. A single container might be used to run anything from a small microservice or software process to a larger application. Inside a container are all the necessary executables, binary code, libraries, and configuration files. Compared to the server or machine virtualization approaches, however, containers do not contain operating system images.

Why use containers?

Containers are a streamlined way to build, test, deploy, and redeploy applications on multiple environments from a developer’s local laptop to an on-premises data center and even the cloud. Benefits of containers include:

  • Less overhead
    Containers require less system resources than traditional or hardware virtual machine environments because they do not include operating system images.
  • Increased portability
    Applications running in containers can be deployed easily to multiple different operating systems and hardware platforms.
  • Greater efficiency
    Containers allow applications to be more rapidly deployed, patched, or scaled.
  • Better application development
    Containers support agile and DevOps efforts to accelerate development, test, and production cycles.

How to install Docker on Ubuntu ?

To install Docker on Ubuntu you need to add the Docker Repository to apt then install Docker CE.

Setup the repository

Update the apt package index and install packages to allow apt to use a repository over HTTPS:

$ sudo apt-get update 
$ sudo apt-get install  apt-transport-https  ca-certificates  curl  gnupg  lsb-release

Add Docker’s official GPG key:

$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

Choose the stable or nightly or test repository by the following command

$ echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
 $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Install Docker Engine

 $ sudo apt-get update
 $ sudo apt-get install docker-ce docker-ce-cli containerd.io

I'm a full stack developer. I have experiences with Java, Android, PHP, Python, C#, Web development...I hope website https://learncode24h.com will help everyone can learn code within 24h and apply it in working easily.

Comments are closed.