Jumat, 07 Januari 2022

How to install Docker

 Guide on how to install docker on Linux for Ubuntu, Debian, CentOS and other distros using the Docker CE for Linux script to make it easier to install Docker. Here are the steps

System updates

For Debian/Ubuntu

apt update -y

For CentOS

yum update -y

Install Curl

For Debian/Ubuntu

apt install curl -y

For CentOS

yum install curl -y

Install Docker

This will download the Docker installation script and execute it

curl -fsSL https://get.docker.com | sh

The script will install docker-ce-cli docker-scan-plugin docker-ceincluding containerd.ioWait until the process is complete.

Creating a sudo user

If you already have a sudo user, please skip this step . If not, I suggest creating a sudo user.

Here I give an example of creating a user with the name omar , and creating a password for the user omar . Run per line one by one.

For Ubuntu/Debian

adduser omar
usermod -aG sudo omar

For CentOS

adduser omar
passwd omar
usermod -aG wheel omar

Adding users to groups docker

This is intended if you login with a user other than rootwhen running a command docker(Docker command-line) so that you don't always run sudo, for example you login with user omar, add the user omarto the users group docker

usermod -aG docker omar

Test

Docker installation is complete, now let's try to run docker

docker run hello-world

The result, something like this, if successful.

Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
2db29710123e: Pull complete
Digest: sha256:cc15c5b292d8525effc0f89cb299f1804f3a725c8d05e158653a563f15e4f685
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

Okay, that's all for the Docker tutorial. In the future I want to learn and share about Docker, hopefully this short article is useful.

Thank you for the support friends give.

Reference:

  • https://www.docker.com
  • https://docs.docker.com

Tags :

bm

Redaksi

Seo Construction

I like to make cool and creative designs. My design stash is always full of refreshing ideas. Feel free to take a look around my Vcard.

  • Redaksi
  • Februari 24, 1989
  • 1220 Manado Trans Sulawesi
  • contact@example.com
  • +123 456 789 111

Posting Komentar