Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install Docker on Centos7 system

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "how to install Docker in Centos7 system". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to install Docker in Centos7 system.

Preface to Docker installation

The installation method of Docker can be described in detail by referring to the documentation on the official website, but because it is an English document, a translation explanation is given in this article.

Https://docs.docker.com/install/linux/docker-ce/centos/#install-docker-engine---community

In this article, we installed the community version of Docker, which can be installed in three ways:

(1) install using the repository

(2) installation of software packages

(3) perform installation through remote script

This document describes the use of repositories to install Docker in the CentOS operating system, which is also officially recommended by Docker. Now let's start with the explanation.

Check the server operating system

The operating system needs to be CentOS 7, and the centos-extras library must be enabled, which is on by default.

2. If you have previously installed Docker, you need to uninstall it.

If you have previously installed an older version of Docker, you need to uninstall it first. Older versions of Docker are called docker or docker-engine. If you have installed these programs, uninstall them and related dependencies.

$sudo yum remove docker\ docker-client\ docker-client-latest\ docker-common\ docker-latest\ docker-latest-logrotate\ docker-logrotate\ docker-engine III. Set up the repository

(1) install the required software packages. Yum-utils provides yum-config-manager utility, and device-mapper-persistent-data and lvm2 are required by devicemapper storage drivers.

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

(2) use the following command to set up a stable repository.

Sudo yum-config-manager\-add-repo\ https://download.docker.com/linux/centos/docker-ce.repo IV. Install Docker (1) if you want to install the latest version of Dockersudo yum install docker-ce docker-ce-cli containerd.io

If prompted to accept the GPG key, verify that the fingerprint matches 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35, and if so, accept it.

(2) install a specified version of Docker to install a specific version of Docker Engine-Community, list the available versions in the repository, and then select and install one. The following command lists and sorts the versions available in your repository. This example sorts the results by version number (from highest to lowest): $yum list docker-ce--showduplicates | sort-rdocker-ce.x86_64 3VR 18.09.1-3.el7 docker-ce-stabledocker-ce.x86_64 3VR 18.09.0-3.el7 docker-ce-stabledocker-ce.x86_64 18.06.1.ce-3.el7 Docker-ce-stabledocker-ce.x86_64 18.06.0.ce-3.el7 docker-ce-stable

The list returned depends on the enabled repository and is specific to your version of CentOS (.el7 is represented by a suffix in this example).

Install a specific version with its fully qualified package name, which is the package name (docker-ce) plus the version string (second column), from the first colon (:) to the first hyphen, separated by a hyphen (-). For example, docker-ce-18.09.1.

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

After execution, Docker is installed and a user group named Docker is created.

Start Dockersudo systemctl start docker 6 and test whether the installation is successful or not

Verify that Docker Engine-Community is installed correctly by running the hello-world image.

Sudo docker run hello-world

This command downloads the test image and runs it in the container. When the container runs, it prints a reference message and exits.

This completes the installation of Docker on the CentOS system. Then you need to do some debugging work after installation. Please click to view: https://my.oschina.net/jiemowudi/blog/3125906

At this point, I believe you have a deeper understanding of "how to install Docker in the Centos7 system". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report