Docker 安装 ( Install Docker Engine on CentOS)

 1、Installation methods

You can install Docker Engine in different ways, depending on your needs:

  • You can set up Docker’s repositories and install from them, for ease of installation and upgrade tasks. This is the recommended approach.

  • You can download the RPM package and install it manually and manage upgrades completely manually. This is useful in situations such as installing Docker on air-gapped systems with no access to the internet.

  • In testing and development environments, you can use automated convenience scripts to install Docker.

2、Install using the yum rpm repository

Before you install Docker Engine for the first time on a new host machine, you need to set up the Docker repository. Afterward, you can install and update Docker from the repository.

2.1、Set up the repository 

Install the yum-utils package (which provides the yum-config-manager utility) and set up the repository.

yum源默认没有docker安装资源,需要添加docker的repo安装源,才能安装docker。

yum install -y yum-utils
#docker 官网安装程序repo源,速度较慢
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
#国内阿里docker安装源,速度较快,可以替换docker官网repo安装源。
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

2.2、Install Docker Engine

2.2.1、Install Docker Engine, containerd, and Docker Compose:

你可能感兴趣的:(docker,容器,运维,云计算)