今天新增一个Docker服务器,Docker安装顺利,启动hello-world测试的时候却出现了问题;

$ docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
1b930d010525: Pull complete
Digest: sha256:2557e3c07ed1e38f26e389462d03ed943586f744621577a99efb77324b0fe535
Status: Downloaded newer image for hello-world:latest
docker: Error response from daemon: OCI runtime create failed: container_linux.go:344: starting container process caused "process_linux.go:293: copying bootstrap data to pipe caused \"write init-p: broken pipe\"": unknown.
ERRO[0006] error waiting for container: context canceled
百度下网上多说是版本问题,可通过升级操作系统内核修复。但是服务器上安装了其他很多应用,不能随意升级系统内核。操作系统是centos7.2,安装docker的时候是当前最新的版本,想想还是应该从重新安装旧的docker版本来解决问题。

出问题的docker版本信息如下:

$ docker version
Client:
Version: 18.09.2
API version: 1.39
Go version: go1.10.6
Git commit: 6247962
Built: Sun Feb 10 04:13:27 2019
OS/Arch: linux/amd64
Experimental: false

Server: Docker Engine - Community
Engine:
Version: 18.09.2
API version: 1.39 (minimum version 1.12)
Go version: go1.10.6
Git commit: 6247962
Built: Sun Feb 10 03:47:25 2019
OS/Arch: linux/amd64
Experimental: false
以前安装正常运行的Docker版本信息如下:

$ docker version
Client:
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版本

$ yum remove docker-ce
Loaded plugins: fastestmirror
Resolving Dependencies
--> Running transaction check
---> Package docker-ce.x86_64 3:18.09.2-3.el7 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================================================================================================================
Removing:
docker-ce x86_64 3:18.09.2-3.el7 @docker-ce-stable 81 M

Transaction Summary
=============================================================================================================================================================================================================================================
Remove 1 Package

Installed size: 81 M
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
/usr/bin/dockerd has not been configured as an alternative for dockerd
Erasing : 3:docker-ce-18.09.2-3.el7.x86_64 1/1
Verifying : 3:docker-ce-18.09.2-3.el7.x86_64 1/1

Removed:
docker-ce.x86_64 3:18.09.2-3.el7

Complete!
参考可以安装的docker版本信息

$ yum list docker-ce --showduplicates | sort -r
* updates: centos.ustc.edu.cn
Loading mirror speeds from cached hostfile
Loaded plugins: fastestmirror
* extras: mirrors.aliyun.com
docker-ce.x86_64 3:18.09.2-3.el7 docker-ce-stable
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.2.ce-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
docker-ce.x86_64 18.03.1.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 18.03.0.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.12.1.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.12.0.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.09.1.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.09.0.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.06.2.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.06.1.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.06.0.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.03.3.ce-1.el7 docker-ce-stable
docker-ce.x86_64 17.03.2.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.03.1.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.03.0.ce-1.el7.centos docker-ce-stable
* base: centos.ustc.edu.cn
Available Packages
通过yum install docker-ce-<VERSION_STRING>指令安装指定18.09.0-3.el7版本,发现问题还在

$ yum install -y docker-ce-18.09.0-3.el7
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.ustc.edu.cn
* extras: mirrors.aliyun.com
* updates: centos.ustc.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package docker-ce.x86_64 3:18.09.0-3.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

......

Complete!
$ docker run hello-world
docker: Error response from daemon: OCI runtime create failed: container_linux.go:344: starting container process caused "process_linux.go:293: copying bootstrap data to pipe caused \"write init-p: broken pipe\"": unknown.
ERRO[0000] error waiting for container: context canceled

参考Docker官方文档https://docs.docker.com/install/linux/docker-ce/centos/,发现Docker安装的时候主要有三个组件docker-ce,docker-ce-cli,containerd.io,都需要指定版本安装,而且从报错信息看主要是containerd.io的问题,对比下两台服务器的containerd.io版本。

有问题containerd.io版本信息如下:

$ yum info installed containerd.io
Loaded plugins: fastestmirror
Installed Packages
Name : containerd.io
Arch : x86_64
Version : 1.2.2
Release : 3.3.el7
Size : 88 M
Repo : installed
From repo : docker-ce-stable
Summary : An industry-standard container runtime
URL : https://containerd.io
License : ASL 2.0
Description : containerd is an industry-standard container runtime with an emphasis on
: simplicity, robustness and portability. It is available as a daemon for Linux
: and Windows, which can manage the complete container lifecycle of its host
: system: image transfer and storage, container execution and supervision,
: low-level storage and network attachments, etc.
正常的containerd.io版本信息如下

$ yum info installed containerd.io
Loaded plugins: fastestmirror
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
Installed Packages
Name : containerd.io
Arch : x86_64
Version : 1.2.0
Release : 3.el7
Size : 88 M
Repo : installed
From repo : docker-ce-stable
Summary : An industry-standard container runtime
URL : https://containerd.io
License : ASL 2.0
Description : containerd is an industry-standard container runtime with an emphasis on
: simplicity, robustness and portability. It is available as a daemon for Linux
: and Windows, which can manage the complete container lifecycle of its host
: system: image transfer and storage, container execution and supervision,
: low-level storage and network attachments, etc.
删除docker-ce,docker-ce-cli,containerd.io,重新安装指定版本

$ yum remove docker-ce docker-ce-cli containerd.io
Loaded plugins: fastestmirror
Resolving Dependencies
--> Running transaction check
---> Package containerd.io.x86_64 0:1.2.2-3.3.el7 will be erased
---> Package docker-ce.x86_64 3:18.09.0-3.el7 will be erased
---> Package docker-ce-cli.x86_64 1:18.09.2-3.el7 will be erased
--> Finished Dependency Resolution

......

Complete!

$yum install -y docker-ce-18.09.0-3.el7 docker-ce-cli-18.09.0-3.el7 containerd.io-1.2.0-3.el7
* base: centos.ustc.edu.cn
* extras: mirrors.aliyun.com
* updates: centos.ustc.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package containerd.io.x86_64 0:1.2.0-3.el7 will be installed
---> Package docker-ce.x86_64 3:18.09.0-3.el7 will be installed
---> Package docker-ce-cli.x86_64 1:18.09.0-3.el7 will be installed
--> Finished Dependency Resolution

......

Complete!
终于测试成功!

$ systemctl start docker
$ docker run hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/

For more examples and ideas, visit:
https://docs.docker.com/get-started/
---------------------
作者:chenxing109
来源:CSDN
原文:https://blog.csdn.net/chenxing109/article/details/87792111
版权声明:本文为博主原创文章,转载请附上博文链接!

Docker安装指定版本的更多相关文章

  1. docker安装指定版本TAG的镜像

    在docker中安装镜像,一般过程是,docker search 软件名称. 本文以tomcat为例,讲解下载指定版本TAG的tomcat. 搜索tomcat镜像 $ sudo docker sear ...

  2. docker安装指定版本nexus3

    安装maven私服 1 下载指定版本的镜像  docker  pull  sonatype/nexus3:3.18.1 2 宿主机创建一个映射目录 ,并设置所有者 mkdir  -p  /app/ne ...

  3. 安装指定版本的docker服务

    参考博客:Docker CE 镜像源站 参考博客:docker启动异常driver not supported 1. 说明 之前部署docker服务的时候都是安装最新的docker版本,并使用dock ...

  4. 容器学习笔记之CentOS7安装Docker(安装指定版本的Docker,加速,卸载)

    0x00 概述 Docker从1.13版本之后采用时间线的方式作为版本号,分为社区版CE和企业版EE. 社区版是免费提供给个人开发者和小型团体使用的,企业版会提供额外的收费服务,比如经过官方测试认证过 ...

  5. 安装指定版本的docker

    安装 Docker 从 2017 年 3 月开始 docker 在原来的基础上分为两个分支版本: Docker CE 和 Docker EE. Docker CE 即社区免费版,Docker EE 即 ...

  6. 在Linux Centos 7.2 上安装指定版本Docker。

    相关资料链接: https://docs.docker.com/install/linux/docker-ce/centos/#install-docker-ce 先清空下“历史” yum remov ...

  7. 在Linux Centos 7.2 上安装指定版本Docker 17.03

    相关资料链接: https://docs.docker.com/install/linux/docker-ce/centos/#install-docker-ce 先清空下“历史” yum insta ...

  8. yum 安装指定版本Docker

    版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明.本文链接:https://blog.csdn.net/weixin_39553910/artic ...

  9. Centos7根据yum源安装指定版本docker

    yum install -y yum-utils device-mapper-persistent-data lvm2 yum-config-manager --add-repo https://mi ...

随机推荐

  1. Scala 上下文界定

    上下文界定的类型参数形式为T:M的形式,其中M是一个泛型,这种形式要求存在一个M[T]类型的隐式值: /** * 上下文界定 */ @Test def testOrdering_Class_Conte ...

  2. (一) 天猫精灵接入Home Assistant- hass对接天猫精灵

    1如何利用论坛的认证服务器对接天猫精灵 说起天猫精灵的接入,最早是由c1pher(25989406)大神通过开发自定义技能接入,后面qebabe大神进行了改进,可以直接通过HASS API读取hass ...

  3. 理解webpack之process.env.NODE_ENV详解(十八)

    在node中,有全局变量process表示的是当前的node进程.process.env包含着关于系统环境的信息.但是process.env中并不存在NODE_ENV这个东西.NODE_ENV是用户一 ...

  4. Java并发(二)异步转同步

    目录 前置条件:构造一个异步调用 一.使用wait和notify方法 二.使用条件锁 三.Future 四.使用CountDownLatch 五.使用CyclicBarrier 总结 在Java并发编 ...

  5. jdk和cglib简单理解

    之前使用cglib的时候不需要将classLoader作为参数传入,但动态代理却要,带着这个疑惑进入这个方法: Proxy.newProxyInstance(classLoader, interfac ...

  6. 51单片机开发板(W25Q16学习)

    教程资料 链接:https://pan.baidu.com/s/142JRSPisQO2Cu6VZ2Y5YrQ 密码:eom0 今天测试开发板的W25Q16(16Mbit--Flash)写一篇文章备忘 ...

  7. 十行代码--用python写一个USB病毒 (知乎 DeepWeaver)

    昨天在上厕所的时候突发奇想,当你把usb插进去的时候,能不能自动执行usb上的程序.查了一下,发现只有windows上可以,具体的大家也可以搜索(搜索关键词usb autorun)到.但是,如果我想, ...

  8. VS2017上执行VS2013项目错误MSB802之解决方案

    进行想把我编写的数字图像处理软件MagicHouse更新到最新的VS2017开发环境下,原来的开发环境是VS2013.但是用VS2017打开项目并编译时,系统报错误MSB802,如下图所示. 其实Vi ...

  9. odoo 装饰器用法@api

    摘自:blog.csdn.net/cmzhuang/article/details/52932883 @api.one one装饰符自动遍历记录集,把self重新定义成当前记录.注意,返回值是一个li ...

  10. Luogu P3177 [HAOI2015]树上染色

    一道有机结合了计数和贪心这一DP两大考点的神仙题,不得不说做法是很玄妙. 首先我们很容易想到DP,设\(f_{i,j}\)表示在以\(i\)为根节点的子树中选\(j\)个黑色节点的最大收益值. 然后我 ...