Install Docker in Linux [2023] Ubuntu, LinuxMint

Introduction

Docker so First of all what docker is: 

have you ever wonder why some code or application works on only your pc and not on someone elses or vice versa. Well their comes docker.

Docker is a solution for easily ship your applications on different development environments resolving the issues of dependencies, environment variables, version of application and many more. 

Docker automatically download and run all required dependencies in an isolated environment called container. This is the beauty of docker. These isolated environments allows docker to run multiple versions of same app side by side. So one application can use node version 14 and other node version 9.

Without docker our developement machine is cluttered with so many dependencies and we even can't remove them after being done with the work. But with docker we can safely remove all the dependencies in one go.

Docker helps us consistently build, run and deliver our application. Therefore now a days a lot of employers are looking for developers with docker skills these days.


Installation:

1. install all docker related packages from the apt repo

sudo apt install docker*


2. check version of docker 


3. start docker as a service

systemctl start docker

systemctl status docker

4. Finally check that everything is right or not 

sudo docker run hello-world

Disclaimer:

By default you have to run all docker commands with sudo.

By default, running Docker commands requires root privileges, which is why you often see the need to use sudo when executing Docker commands on Linux. The reason for this requirement is related to security and the potential impact of Docker on your system.

When you run Docker commands, you are interacting with the Docker daemon, which is responsible for managing containers, images, and other Docker-related operations. The Docker daemon needs to interact with system resources such as networking, file systems, and hardware in a way that could potentially impact the entire system. To ensure that these operations are controlled and secure, Docker commands often require elevated privileges.

Using sudo (which stands for "superuser do") is a way to execute commands with superuser or root privileges. However, it's worth noting that running Docker commands with sudo has some implications:

  1. Security: Running Docker commands with sudo ensures that only authorized users can manage Docker containers and images, which helps prevent unauthorized access or malicious activity.
  2. Isolation: Containers have the potential to impact system resources, and running Docker commands with sudo provides an additional layer of isolation and control.
  3. System Safety: Since Docker interacts with various system resources, using sudo helps prevent accidental or unintentional modifications to critical parts of the system.
Next Post Previous Post
No Comment
Add Comment
comment url