美文网首页Linux-Vps-Docker
阿里云Ubuntu16.04 服务器安装Docker

阿里云Ubuntu16.04 服务器安装Docker

作者: 疯狂的橙 | 来源:发表于2017-01-03 13:18 被阅读1713次

Docker简介

引用参考:
https://help.aliyun.com/knowledge_detail/42851.html
https://docs.docker.com/engine/installation/linux/ubuntulinux/

准备工作:

  • 阿里云服务器
  • SecureCRT (其他终端皆可)
  • 网络连通...

阿里云Ubuntu 16.04 64位服务器


$ sudo apt-get update

如果内核版本较旧,则需要先更新内核,以下是更新xenial内核

$ sudo apt-get install linux-image-generic-lts-xenial
$ sudo reboot

使用curl获取最新的Docker (使用阿里的镜像服务且使用云服务器外部网络下载)

$ curl -sSL http://acs-public-mirror.oss-cn-hangzhou.aliyuncs.com/docker-engine/internet | sh -

使用curl获取最新的Docker (使用阿里的镜像服务且使用云服务器内部网络下载)
目前未通过

$ curl -sSL http://acs-public-mirror.oss-cn-hangzhou.aliyuncs.com/docker-engine/intranet | sh -
安装成功后运行Docker的提示信息

提示:此时Docker已安装完成,但Docker下载镜像会相当的慢

使用阿里云的加速器,也就是阿里云的又一个镜像

使用阿里云的开发者平台登录云服务器后台 https://dev.aliyun.com/

Paste_Image.png

找到加速器地址,配置镜像的地址(直接执行命令)


Paste_Image.png
sudo mkdir -p /etc/systemd/system/docker.service.d
sudo tee /etc/systemd/system/docker.service.d/mirror.conf <<-'EOF'
[Service]
ExecStart=
ExecStart=/usr/bin/docker daemon -H fd:// --registry-mirror=https://***l0kzl.mirror.aliyuncs.comEOF
sudo systemctl daemon-reload
sudo systemctl restart docker

测试
因为使用阿里云内网地址下载,使用加速器后下载的速度很快

Paste_Image.png

相关文章

网友评论

本文标题:阿里云Ubuntu16.04 服务器安装Docker

本文链接:https://www.haomeiwen.com/subject/orwgvttx.html