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

Docker Foundation (1)-install Docker

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Configuration environment: CentOS-7.5

It is recommended to allocate at least 4g of memory

Enable Virtualization:

Download docker-ce.repo from Aliyun open source site

[root@www ~] # wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo[root@www ~] # mv docker-ce.repo / etc/yum.repos.d/ [root@www ~] # yum repolist loaded plug-in: fastestmirror LangpacksLoading mirror speeds from cached hostfile * epel: mirror.horizon.vn source identification source name status EPEL/7/x86_64 CentOS-7-Base-163.com 9911base cdrom 9911docker-ce-stable/x86_64 Docker CE Stable-x86-64 25epel/x86_64 Extra Packages for Enterprise Linux 7-x86-64 12703extras/7/x86_64 CentOS-7-Extras-163. Com 434updates/7/x86_64 CentOS-7-Updates-163.com 1614repolist: 34598

Check the baseurl in its configuration file to see whether it is a domestic mirror resource site. If it is a public network, it is recommended to modify it with the last line mode, otherwise, it is not only slow but also needs to surf the Internet scientifically.

[root@www ~] # cat / etc/yum.repos.d/docker-ce.repo [docker-ce-stable] name=Docker CE Stable-$basearchbaseurl= https://mirrors.aliyun.com/docker-ce/linux/centos/7/$basearch/stableenabled=1gpgcheck=1gpgkey=https://mirrors.aliyun.com/docker-ce/linux/centos/gpg [docker-ce-stable-debuginfo] name=Docker CE Stable-Debuginfo $basearchbaseurl= https://mirrors.aliyun.com/docker-ce/linux/centos/7/debug-$basearch/stableenabled=0gpgcheck=1gpgkey=https://mirrors.aliyun. Com/docker-ce/linux/centos/gpg [docker-ce-stable-source] name=Docker CE Stable-Sourcesbaseurl= https://mirrors.aliyun.com/docker-ce/linux/centos/7/source/stableenabled=0gpgcheck=1gpgkey=https://mirrors.aliyun.com/docker-ce/linux/centos/gpg [docker-ce-edge] name=Docker CE Edge-$basearchbaseurl= https://mirrors.aliyun.com/docker-ce/linux/centos/7/$basearch/edgeenabled=0gpgcheck=1gpgkey=https://mirrors.aliyun.com/docker-ce/linux/centos/gpg [docker- Ce-edge-debuginfo] name=Docker CE Edge-Debuginfo $basearchbaseurl= https://mirrors.aliyun.com/docker-ce/linux/centos/7/debug-$basearch/edgeenabled=0gpgcheck=1gpgkey=https://mirrors.aliyun.com/docker-ce/linux/centos/gpg [docker-ce-edge-source] name=Docker CE Edge-Sourcesbaseurl= https://mirrors.aliyun.com/docker-ce/linux/centos/7/source/edgeenabled=0gpgcheck=1gpgkey=https://mirrors.aliyun.com/docker-ce/linux/centos/gpg [docker-ce-test] name=Docker CE Test-$basearchbaseurl=https : / / mirrors.aliyun.com/docker-ce/linux/centos/7/$basearch/testenabled=0gpgcheck=1gpgkey= https://mirrors.aliyun.com/docker-ce/linux/centos/gpg [docker-ce-test-debuginfo] name=Docker CE Test-Debuginfo $basearchbaseurl= https://mirrors.aliyun.com/docker-ce/linux/centos/7/debug-$basearch/testenabled=0gpgcheck=1gpgkey=https://mirrors.aliyun.com/docker-ce/linux/centos/gpg [docker-ce-test-source] name=Docker CE Test-Sourcesbaseurl= https://mirrors.aliyun.com/ Docker-ce/linux/centos/7/source/testenabled=0gpgcheck=1gpgkey= https://mirrors.aliyun.com/docker-ce/linux/centos/gpg [docker-ce-nightly] name=Docker CE Nightly-$basearchbaseurl= https://mirrors.aliyun.com/docker-ce/linux/centos/7/$basearch/nightlyenabled=0gpgcheck=1gpgkey=https://mirrors.aliyun.com/docker-ce/linux/centos/gpg [docker-ce-nightly-debuginfo] name=Docker CE Nightly-Debuginfo $basearchbaseurl= https://mirrors.aliyun.com/docker-ce/linux/centos/7/debug-$basearch / nightlyenabled=0gpgcheck=1gpgkey= https://mirrors.aliyun.com/docker-ce/linux/centos/gpg [docker-ce-nightly-source] name=Docker CE Nightly-Sourcesbaseurl= https://mirrors.aliyun.com/docker-ce/linux/centos/7/source/nightlyenabled=0gpgcheck=1gpgkey=https://mirrors.aliyun.com/docker-ce/linux/centos/gpg

Then we can install docker-ce directly with yum.

[root@www ~] # yum install docker-ce loaded plug-ins: fastestmirror, langpacksLoading mirror speeds from cached hostfile * epel: mirror.horizon.vn is resolving dependencies-- > checking transactions-- > package docker-ce.x86_64.3.18.09.0-3.el7 will be installed-- > processing dependencies container-selinux > = 2.9 It is required by package 3:docker-ce-18.09.0-3.el7.x86_64-- > processing dependency containerd.io, it is required by package 3:docker-ce-18.09.0-3.el7.x86_64-- > processing dependency docker-ce-cli It is required by package 3:docker-ce-18.09.0-3.el7.x86_64-- > checking transaction-- > package container-selinux.noarch.2.2.68-1.el7 will be installed-- > package containerd.io.x86_64.0.1.2.0-3.el7 will be installed-- > package docker-ce-cli.x86_64.1.18.09.0-3. El7 will be installed-- > resolve dependencies complete dependency resolution = Package schema version source size = installing: docker-ce x86 resolve 64 3 docker-ce 18.09.0-3.el7 docker-ce-stable 19 M installed for dependency: container-selinux noarch 2vl 2.68-1.el7 extras 36 k containerd.io x86 "64 1.2.0-3.el7 docker-ce-stable 22 M docker-ce-cli x86" 64 1 containerd.io 18.09.0-3.el7 Docker-ce-stable 14 M transaction Summary = install 1 package (+ 3 dependent packages) Total downloads: 55m installation size: 235 MIs this ok [y/d/N]: yDownloading packages: (1Take 4): container-selinux-2.68-1.el7.noarch.rpm | 36 kB 00:00:03 warning: / var/cache/yum/x86_64/ 7/docker-ce-stable/packages/containerd.io-1.2.0-3.el7.x86_64.rpm: Header V4 RSA/SHA512 Signature Key ID 621e9f35: the public key of NOKEYcontainerd.io-1.2.0-3.el7.x86_64.rpm has not been installed (2 MB 4): containerd.io-1.2.0-3.el7.x86_64.rpm | 22 MB 00:00:09 (3 3.el7.x86_64.rpm 4): docker-ce-cli-18.09.0-3.el7.x86_64.rpm | | 14 MB 00:00:04 (4 amp 4): docker-ce-18.09.0-3.el7.x86_64.rpm | 19 MB 00:00:19-- | -- A total of 2.8MB/s | 55 MB 00:00:19 retrieve keys from https://mirrors.aliyun.com/docker-ce/linux/centos/gpg and import them into GPG key 0x621E9F35: User ID: "Docker Release (CE rpm)" fingerprint: 060a 61c5 1b55 8a7f 742b 77aa c52f eb6b 621e 9f35 from: does https://mirrors.aliyun.com/docker-ce/linux/centos/gpg continue? [y 3.el7.x86_64 N]: yRunning transaction checkRunning transaction testTransaction test succeededRunning transaction is being installed: containerd.io-1.2.0-3.el7.x86_64 1 + 4 is being installed: 1:docker-ce-cli-18.09.0-3.el7.x86_64 2 + 4 is being installed. 2:container-selinux-2.68-1.el7.noarch 3/4setsebool: SELinux is disabled. Installing: 3:docker-ce-18.09.0-3.el7.x86_64 4 amp 4 verification: 1:docker-ce-cli-18.09.0-3.el7.x86_64 1 hand 4 verification: 3:docker-ce-18.09 .0-3.el7.x86_64 2amp 4 verification: containerd.io-1.2.0-3.el7.x86_64 3amp 4 verification: 2:container-selinux-2.68-1.el7.noarch 4 container-selinux.noarch 4 has been installed: container-selinux.noarch 3 1.el7 containerd.io.x86_64 18.09.0-3.el7 installed as a dependency: CPV 2 Vera 2.68-1.el7 containerd.io.x86_64 0Rule 1.2.0-3.el7 docker -ce-cli.x86_64 1VR 18.09.0-3.el7 over!

It is recommended to set the enable property on docker, turn on docker, and check its version

[root@www ~] # systemctl enable dockerCreated symlink from / etc/systemd/system/multi-user.target.wants/docker.service to / usr/lib/systemd/system/docker.service. [root@www ~] # systemctl start docker [root@www ~] # docker versionClient: Version: 18.09.0 API version: 1.39 Go version: go1.10.4 Git commit: 4d60db4 Built: Wed Nov 7 00:48: 22 2018 OS/Arch: linux/amd64 Experimental: false Server: Docker Engine-Community Engine: Version: 18.09.0 API version: 1.39 (minimum version 1.12) Go version: go1.10.4 Git commit: 4d60db4 Built: Wed Nov 7 00:19:08 2018 OS/Arch: linux/amd64 Experimental: false

Docker is owned by a separate warehouse, and its content is usually on docker hub, so we need to apply for an account on docker hub with the address https://hub.docker.com.

Note:

1. If we apply for the first time and our browser does not have a plug-in for scientific access to the Internet, then the final sign up option is gray and cannot be clicked, because we have no way to receive email, so we need to install a plug-in on our browser so that we can surf the Internet scientifically and receive a receipt email.

2. The specific plug-in name is: Google access Assistant

3. Tutorial link: http://www.ggfwzs.com

1. After applying for an account, we can simply create a small nginx image to test:

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

Servers

Wechat

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

12
Report