Docker安装指定版本

今天新增一个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
版权声明:本文为博主原创文章,转载请附上博文链接!

原文地址:https://www.cnblogs.com/php-linux/p/10493779.html

时间: 2024-10-22 02:20:26

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

Centos7 安装指定版本的 Docker

Centos 安装指定版本的 Docker 安装kubernetes 集群,个别kubernetes对docke版本有要求,简单整理安装指定版本docker过程如下: kubernetes 版本依赖确认: https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.14.md#external-dependencies 删除现有版本 docker 版本 yum remove docker-ce docker-ce-selinu

使用Nuget 安装指定版本package或者更新package到指定版本

最近在琢磨MVC和EntityFramework,使用的VS是2013版的,在Nuget的GUI界面下安装了EntityFramework(默认安装最新版的,怎么安装指定版本还没找到),按照MVC的示例项目MusicStore逐步做的过程中发现MVC4不支持EntityFramwok 6. 尝试去更新MVC版本各种失败,只能试着去降低EntityFramework版本.但是通过Nuget的GUI界面无法安装或更新到指定版本的EntityFramwok.在网上搜了搜相关资料(事实上也很容易搜到),

nodejs安装指定版本

由于express有各种不同的版本,不同的版本开发方式有所不同,如果想安装指定版本可以选择全局安装指定版本: 安装步骤如下: (1) 安装2.5.8版本的express的方法: C:\Users\Linda\AppData\Roaming\npm\node_modules 这是全局express的安装目录 这个文件夹是隐藏文件夹,为了将隐藏文件改为可以看到的文件我们用到的是: 文件夹选项/查看/隐藏文件和文件夹/显示隐藏的文件 为了安装指定版本的express文件我们必须把安装的express文

Mac系统下brew安装指定版本的nodejs小笔记

http://www.jincon.com/archives/429/ Mac系统下brew安装指定版本的nodejs小笔记

CentOS 下yum安装指定版本mysql的过程

在linux安装指定版本mysql是一个困难的事情,yum安装一般是安装的mysql5.1,现在经过自己不懈努力终于能用yum安装mysql5.5了. 1.安装mysql-5.5的yum源 rpm -ivh http://repo.mysql.com/yum/mysql-5.5-community/el/6/x86_64/mysql-community-release-el6-5.noarch.rpm 2.修改安装好的yum源 编辑 /etc/yum.repos.d/mysql-communit

pip install 安装指定版本的包

pip install 安装指定版本的包 要用 pip 安装指定版本的 Python 包,只需通过 == 操作符 指定 pip install robotframework==2.8.7 将安装robotframework 2.8.7 版本. 原文地址:https://www.cnblogs.com/AlvinLau/p/8662890.html

pip 查看已安装模块、卸载指定模块、安装指定版本模块

操作背景 最近使用 pandas+plotly 画heatmap(热力图),来处理股票数据,语法.步骤都没问题,但到画图那一步老是报错,且 plotly 版本为3.0.0: 最后找到原因,plotly版本的问题,3.0.0 版本会报错,只好降到 2.7.0版本: 平时 pip 都是安装模块,很少卸载,记不清具体用法了,就查了下,顺便总结记录. 查看已安装模块 代码: pip list 输入 pip list  就会看到目前已安装的模块(模块名以及版本): 卸载指定模块 代码: pip unins

centos7下安装指定版本mysql5.7.23

现在mysql版本已经到MySQL 8.0(GA)稳定版本了,所以需求是想简单又快速在centos7下安装指定版本例如MySQL 5.7(GA)版本有下面这种方法 首先需要到mysql官网这里下载对应RPM包来update一下 1.全新安装MySQL的步骤 我这边是想安装5.7.23版本,然后这个rpm包是最新8.0版本的,这边我就需要做点操作了: 首先,将MySQL Yum存储库添加到系统的存储库列表中.按着这些次序: 在http://dev.mysql.com/downloads/repo/

yum命令showduplicates安装指定版本包

默认情况下,我们用yum list 或者 yum install 的时候,yum会默认选择最新的版本. 如果我们需要安装指定版本的某个软件包,以使之能够和我们现有环境的软件包版本匹配,那么就需要用到showduplicates 使用--showduplicates参数列出所有版本 查看docker-ce: yum list docker-ce 可安装的软件包 docker-ce.x86_64 查看docker-ce各个版本: yum list docker-ce --showduplicate