星空网 > 软件开发 > 操作系统

在阿里云主机的Debian操作系统上安装Docker

## 下面命令都是以root用户执行## 查看内核版本uname -a# Debian 3.2.0-4 x86_64## 版本太低了 < 3.8## 参照 http://docs.docker.com/installation/debian/ 升级内核deb http://http.debian.net/debian wheezy-backports mainapt-get updateapt-get install -t wheezy-backports linux-image-amd64## 重启系统restart## 安装 docker 前,需要安装 curlapt-get install curl## 安装 dockercurl -sSL https://get.docker.com/ | sh## 重启 docker 服务.service docker restart## 运行 hello worlddocker run hello-world## 不出意外的话会出现# FATA[0000] Get http:///var/run/docker.sock/v1.18/containers/json?all=1: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS? ## 这是docker服务没有启动service docker status# 会看到# [FAIL] Docker is not running ... failed!# 确实没启动## 显示启动一下docker -d ## 会看到# INFO[0000] +job serveapi(unix:///var/run/docker.sock)  # INFO[0000] Listening for HTTP on unix (/var/run/docker.sock) # INFO[0000] +job init_networkdriver()          # Could not find a free IP address range for interface 'docker0'. Please configure its address manually and run 'docker -b docker0'# INFO[0000] -job init_networkdriver() = ERR (1)     # FATA[0000] Shutting down daemon due to errors: Could not find a free IP address range for interface 'docker0'. Please configure its address manually and run 'docker -b docker0'## 因为阿里云把所有内网IP都占用了。所以要改下。vi /etc/network/interfaces## 把 "up route add -net 172.16.0.0 netmask 255.240.0.0 gw 10.170.191.247 dev eth0" 这一注释掉(在这一行最前面加'#')/etc/init.d/networking restartservice docker startservice docker status## 能看到 docker is running.docker run hello-world## 能看到 hello-world 启动了# Hello from Docker.# This message shows that your installation appears to be working correctly.## 把非管理员用户添加到docker组,方便使用useradd -G docker <user_login>



原标题:在阿里云主机的Debian操作系统上安装Docker

关键词:docker

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

国际平邮物流有哪些:https://www.goluckyvip.com/tag/32343.html
国际散货海运价格:https://www.goluckyvip.com/tag/32344.html
国际散货海运专线:https://www.goluckyvip.com/tag/32345.html
广东省:https://www.goluckyvip.com/tag/3235.html
发达国家:https://www.goluckyvip.com/tag/3236.html
国际商业快递:https://www.goluckyvip.com/tag/32361.html
独家丨B站广告位可跳转美团APP B站为电商平台引流再升级 :https://www.kjdsnews.com/a/1836410.html
百崖大峡谷生态旅游景区(探秘中国西南自然风光):https://www.vstour.cn/a/363176.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流