docker基础安装使用

相关主题
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

Docker基础安装使用

2020-02-22

作者:刘子毅

创建yum源

[root@bogon ~]#

[root@bogon ~]# yum-config-manager --add-repo https:///linux/centos/docker-ce.repo

Loaded plugins: fastestmirror, langpacks

adding repo from: https:///linux/centos/docker-ce.repo

grabbing file https:///linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo

Could not fetch/save url https:///linux/centos/docker-ce.repo to file /etc/yum.repos.d/docker-ce.repo: [Errno 14] curl#7 - "Failed connect to :443; Operation now in progress"

[root@bogon ~]#

[root@bogon ~]#

链接无法解析改为使用阿里的yum源,操作如下:

[root@bogon ~]# yum-config-manager --add-repo /docker-ce/linux/centos/docker-ce.repo

Loaded plugins: fastestmirror, langpacks

adding repo from: /docker-ce/linux/centos/docker-ce.repo

grabbing file /docker-ce/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo

repo saved to /etc/yum.repos.d/docker-ce.repo

安装最新的docker

[root@bogon ~]#

[root@bogon ~]# yum install docker-ce

Loaded plugins: fastestmirror, langpacks

Existing lock /var/run/yum.pid: another copy is running as pid 9034.

Another app is currently holding the yum lock; waiting for it to exit...

The other application is: PackageKit

Memory : 119 M RSS (1.0 GB VSZ)

Started: Fri Feb 21 19:28:47 2020 - 07:27 ago

State : Sleeping, pid: 9034

Another app is currently holding the yum lock; waiting for it to exit...

The other application is: PackageKit

Memory : 119 M RSS (1.0 GB VSZ)

Started: Fri Feb 21 19:28:47 2020 - 07:29 ago

State : Sleeping, pid: 9034

Another app is currently holding the yum lock; waiting for it to exit...

The other application is: PackageKit

Memory : 119 M RSS (1.0 GB VSZ)

Started: Fri Feb 21 19:28:47 2020 - 08:12 ago

State : Sleeping, pid: 9034

^C

Exiting on user cancel.

此处发下yum被进程号为9034占用,直接kill

[root@bogon ~]# ps aux | grep yum

root 9034 2.5 12.2 1041184 121668 ? SN 19:28 0:13 /usr/bin/python /usr/share/PackageKit/helpers/yum/yumBackend.py get-updates none

root 10322 0.0 0.0 112708 976 pts/0 S+ 19:37 0:00 grep --color=auto yum

[root@bogon ~]# kill -9 9034

[root@bogon ~]# ps aux | grep yum

root 10338 0.0 0.0 112708 976 pts/0 R+ 19:37 0:00 grep --color=auto yum

[root@bogon ~]#

[root@bogon ~]#

[root@bogon ~]#

[root@bogon ~]#

重新安装docker,如下:

[root@bogon ~]# yum install docker-ce

BDB2053 Freeing read locks for locker 0x9ba: 9034/140061293627200

BDB2053 Freeing read locks for locker 0x9bc: 9034/140061293627200

Loaded plugins: fastestmirror, langpacks

Loading mirror speeds from cached hostfile

* base:

* extras:

* updates:

docker-ce-stable

| 3.5 kB 00:00:00

(1/2): docker-ce-stable/x86_64/primary_db | 38 kB 00:00:00

(2/2): docker-ce-stable/x86_64/updateinfo | 55 B 00:00:00

Resolving Dependencies

--> Running transaction check

---> Package docker-ce.x86_64 3:19.03.6-3.el7 will be installed

--> Processing Dependency: container-selinux >= 2:2.74 for package: 3:docker-ce-19.03.6-3.el7.x86_64

--> Processing Dependency: containerd.io >= 1.2.2-3 for package: 3:docker-ce-19.03.6-3.el7.x86_64

--> Processing Dependency: docker-ce-cli for package: 3:docker-ce-19.03.6-3.el7.x86_64

--> Running transaction check

---> Package container-selinux.noarch 2:2.107-3.el7 will be installed

---> Package containerd.io.x86_64 0:1.2.10-3.2.el7 will be installed

相关文档
最新文档