Docker CentOS installation method

installation method##

Based on your needs, you can install the Docker Engine in different ways:

Install using the warehouse###

Before you install Docker on the newly installed machine, you need to set up the Docker repository. After the warehouse is set up, you can install and update Docker from the set warehouse.

Set up warehouse

Install the yum-utils package (this installation package will provide the yum-config-manager tool) and set up a stable repository.

$ sudo yum install -y yum-utils

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

Optional: Enable nightly or test repository.
The above repositories contain docker.repo files, but they are disabled by default. You can enable them the same as the stable version repository address. The following content shows the command to enable the nightly repository.
$ sudo yum-config-manager --enable docker-ce-nightly
To enable the test (test) repository, please use the following command:
$ sudo yum-config-manager --enable docker-ce-test
You can disable the nightly or test repository by running the yum-config-manager command and adding the --disable flag after the command.
The following command means to disable the nightly repository:
$ sudo yum-config-manager --disable docker-ce-nightly
Learn more about nightly and test channels. .

Install Docker Engine####

  1. Install the newest version of the Docker engine and container, or use the following steps to specify a specific version for the installation: $ sudo yum install docker-ce docker-ce-cli containerd.io
    If you are prompted to verify the GPG Key when you follow it, please make sure that the fingerprint is consistent with the character string 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35, and then select Accept.
    Got multiple Docker repositories?
    If you have multiple Docker repositories enabled, when using the yum install or yum update command to install and upgrade Docker, if you do not specify the version,
    Then the above command will try to install using the latest version. This may cause the installed version to be not what you need.
    Docker is installed, but not started. This is because the docker group has been created, but no users have been added to the group.

  2. For Docker installation specify version of the Docker Engine (Docker Engine), list the Docker versions available in a given warehouse, and then select the required version to install: a. List the Docker versions available in your warehouse by category. The following example lists the results of classification by version, from high to low:
    $ yum list docker-ce --showduplicates | sort -r docker-ce.x86_64 3:18.09.1-3.el7 docker-ce-stable docker-ce.x86_64 3:18.09.0-3.el7 docker-ce-stable docker-ce.x86_64 18.06.1.ce-3.el7 docker-ce-stable docker-ce.x86_64 18.06.0.ce-3.el7 docker-ce-stable
    The above list is to specify the version of your CentOS operating system based on the repository you enable (as shown above, use the suffix el7 to mark).
    b. Install the specified version of the Dock engine by providing the complete package name. The full path includes the package name (docker-ce) and the version string provided in the second column.
    The calculation starts from the character after the first colon (:) and ends with the character before the separator (-).
    For example: docker-ce-18.09.1.
    $ sudo yum install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io
    Docker is installed, but not started. This is because the docker group has been created, but no users have been added to the group.

  3. Start Docker $ sudo systemctl start docker

  4. Run the hello-world image (image) to confirm that the Docker installation is successful. $ sudo docker run hello-world
    This command will download a test image and run it in the container. If the container is running, this command will print out some information and exit.

The Docker engine has been installed and running, you need to use sudo to run Docker commands. Please continue to read the page [Linux 安装 Docker 的后续步骤](Linux 安装 Docker 的后续步骤)
To allow users without permission in your operating system to allow Docker commands and other configuration options.

Upgrade Docker engine####

If you want to apply for the Docker engine, please follow the steps of Install using warehouse to select the new version you want to install.

The result of the installation on the operating system.

All complete commands executed:

sudo yum install -y yum-utils

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

sudo yum install docker-ce docker-ce-cli containerd.io

sudo systemctl start docker

sudo docker run hello-world

https://www.ossez.com/t/docker-centos/717#install-using-the-repository

Recommended Posts

Docker CentOS installation method
Docker installation (CentOS7 installation)
CentOS7 docker installation
Centos7 docker installation details
CentOS environment installation of Docker
2019-07-09 CentOS7 installation
centos7_1708 installation
Docker EE installation on centos7
Centos5 installation guide
CentOS 7 install Docker
CentOS7 install Docker
Centos7 install Docker
Centos7 install docker18
CentOS 6 install Docker
Centos8 install Docker
CentOS container installation in Docker uses MySQL
CentOS online installation RabbitMQ3.7
Install Docker on Centos7
Zabbix 2.2.20 installation details (Centos6.9)
CentOS 7 install Docker service
Centos source installation Python3
Centos7 mqtt cluster installation
CentOS 8.0 installs docker error
Graphical installation of CentOS8
Mysql8.0.15 installation configuration (centos7)
Linux notes (1): CentOS-7 installation
CentOS 8-dnf install docker
Redis3 installation under Centos7
install Docker on centos6.5
CentOS online installation RabbitMQ3.7
Linux CentOS 7 installation tutorial
CentOS 7 install Docker CE
Centos8 (minimal installation) a new installation of Python3.8+pip method tutorial
Discourse CentOS 8 new installation manual
Build docker environment under Centos6.5
Centos 7 mini installation process record
Centos mysql installation and configuration
Centos7.6 method to install Tomcat-8.5.39
Glusterfs cluster installation on Centos7
Redis cluster installation under CentOS
Centos7 installation and configuration prometheus
CentOS 7 Galera Cluster installation guide
CentOS 7 installation and configuration PPTP
CentOS 6.x installation mysql5.7 record
Install docker transfer on Centos7
CentOS installation and configuration cmake
Graphical centos installation detailed process
Centos7.5 installation and configuration MongoDB4.0.4
CentOS 7 installation and configuration PPTP
Hyper-V + CentOS7 installation video tutorial
centos7 kvm installation and use
Install docker on Centos system
CentOS7 postgresql installation and use
Centos7 installation tomcat process introduction
Centos7.4 environment installation lamp-php7.0 tutorial
Discourse CentOS 8 new installation manual
CentOS8 Linux 8.0.1905 installation process (illustration)
Centos7 elk7.1.1 installation and use
Centos7 installation and configuration of Jenkins
Analysis of Hyper-V installation CentOS 8 problem
Centos iso image file installation tutorial