阿里云ECS安装Docker

本文详细介绍在阿里云ESC上安装Docker的过程及遇到的问题与解决办法,包括内核版本注意事项、依赖安装、启动服务常见错误及解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

阿里云ESC系统信息,官方说2.6内核运行docker服务可能会不稳定;

$ uname -a
Linux iZ259dixwg8Z 2.6.32-431.23.3.el6.x86_64 #1 SMP Thu Jul 31 17:20:51 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

 

安装过程参考: http://www.docker.org.cn/book/install/install-docker-on-rhel-29.html

 

1. 本机未安装curl,需要先安装curl:

$ yum install curl

2. 执行docker安装脚本:

$ curl -sSL https://get.docker.com/ | sh 

3. 启动docker服务,启动过程中遇到了一些问题,本文后面统一说明;

$ service docker start

4. 查看docker版本:

$ docker version
Client version: 1.7.1
Client API version: 1.19
Go version (client): go1.4.2
Git commit (client): 786b29d
OS/Arch (client): linux/amd64
Server version: 1.7.1
Server API version: 1.19
Go version (server): go1.4.2
Git commit (server): 786b29d
OS/Arch (server): linux/amd64

5. 验证安装,显示以下信息表示成功;

$ 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.
 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://cloud.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/engine/userguide/

 

service docker start启动过程中遇到的问题:

查看日志:

docker -h

或者:

cat /var/log/docker

 

问题1:

symbol dm_task_get_info_with_deferred_remove, version Base not defined in file     libdevmapper.so.1.02 with link time reference

解决方法:

$ yum upgrade device-mapper-libs

 

问题2:

Error starting daemon: Error initializing network controller: Error cr    eating default "bridge" network: can't find an address range for interface "docker0"

解决方法:

route del -net 172.16.0.0/12

如果想每次服务器启动都生效的话,可以修改下路由文件,去掉下面的172.16.0.0/12 via 10.170.247.247 dev eth0 这一行

/etc/sysconfig/network-scripts/route-eth0

10.0.0.0/8 via 10.170.247.247 dev eth0
100.64.0.0/10 via 10.170.247.247 dev eth0
172.16.0.0/12 via 10.170.247.247 dev eth0
192.168.0.0/16 via 10.170.247.247 dev eth0

该问题具体原因查看:http://hanjianwei.com/2014/07/30/docker-on-aliyun/

 

问题3:在docker run hello-world的时候,设备突然重启了,重启后执行此命令显示

$ docker run hello-world
Error response from daemon: EOF

解决方法:

$ docker pull hello-world

 

转载于:https://www.cnblogs.com/wanpengcoder/p/6394871.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值