1. Install docker on centos7

Time:2019-10-21

Docker is becoming more and more popular. This is the first chapter of docker. Let’s follow it.

Installation dependency

yum install -y yum-utils device-mapper-persistent-data lvm2

Set up the yum warehouse of docker.

yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

Before installation, you can view all docker versions in all warehouses.

sudo yum list docker-ce --showduplicates | sort -r

If you don’t want to choose, install by default

sudo yum install docker-ce -y

Start docker

sudo systemctl start docker

Set startup

sudo systemctl enable docker

When docker is installed, the docker user group is created by default. By adding ordinary users to the docker user group, you can operate docker without sudo.

Sudo usermod - Ag docker user name

Change the active group of the current user

newgrp - docker

The article first appeared on my blog: http://www.mi360.cn/articles/6