Install Docker on CentOS or Ubuntu

What is Docker Engine ?

[1] Docker Engine is an open source containerization technology for building and containerizing your applications. Docker Engine acts as a client-server application with:
  • A server with a long-running daemon process dockerd.
  • APIs which specify interfaces that programs can use to talk to and instruct the Docker daemon.
  • A command line interface (CLI) client docker.
This article describes how to install docker on a CentOS or Ubuntu machine (virtual or physical).

CentOS

Cleaning 

Start removing Older versions of Docker.
$ sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine

Requirements

Install required packages for configuration management utility, and storage driver.
$ sudo yum install -y yum-utils device-mapper-persistent-data lvm2

Before starting the installation of Docker Community Edition for the first time on your machine, you need to set up the Docker repository.
$ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

Installing 


After adding the Docker repository, you can install Docker from this repository.
$ sudo yum install -y docker-ce docker-ce-cli containerd.io

Starting


To start docker on your machine, run:

$ sudo systemctl start docker

Chenking

To check if docker is properly installed on your host machine, run:
$ sudo docker run hello-world

Bonus

To enable docker start on machine startup, run:
$ sudo systemctl enable docker

Ubuntu

Cleaning 


Start removing Older versions of Docker.
$ sudo apt-get remove docker docker-engine docker.io containerd runc

Requirements

Update the apt package index.
$ sudo apt-get update

Installing 


After adding the Docker repository, you can install Docker from this repository.
$ sudo apt-get install docker-ce docker-ce-cli containerd.io

Chenking

To check if docker is properly installed on your host machine, run:
$ sudo docker run hello-world


Links
  • [1] https://docs.docker.com/install/

Commentaires

Posts les plus consultés de ce blog

How to increase Pods limit per worker node in Kubernetes

Knative vs OpenFaaS: What are the differences?

How to Create a personal cloud at home using Openstack