docker命令自动安装
docker命令自动安装
操作
操作就是执行两句脚本
curl -fsSL get.docker.com -o get-docker.sh
这句命令会在当前文件夹下下载一个get-docker.sh的脚本,就是get.docker.com的访问结果
sh get-docker.sh --mirror Aliyun
执行脚本,并将镜像源改为阿里的镜像源
正常脚本输出
执行脚本后的输出
root@microservicehost:~# ./get-docker.sh --mirror Aliyun
# Executing docker install script, commit: 40b1b76
+ sh -c apt-get update -qq >/dev/null
+ sh -c apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null
+ sh -c curl -fsSL "https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg" | apt-key add -qq - >/dev/null
+ sh -c echo "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu xenial edge" > /etc/apt/sources.list.d/docker.list
+ sh -c apt-get update -qq >/dev/null
+ sh -c apt-get install -y -qq --no-install-recommends docker-ce >/dev/null
+ sh -c 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:50 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:42:13 2019
OS/Arch: linux/amd64
Experimental: false
If you would like to use Docker as a non-root user, you should now consider
adding your user to the "docker" group with something like:
sudo usermod -aG docker your-user
Remember that you will have to log out and back in for this to take effect!
WARNING: Adding a user to the "docker" group will grant the ability to run
containers which can be used to obtain root privileges on the
docker host.
Refer to https://docs.docker.com/engine/security/security/#docker-daemon-attack-surface
for more information.
** DOCKER ENGINE - ENTERPRISE **
If you’re ready for production workloads, Docker Engine - Enterprise also includes:
* SLA-backed technical support
* Extended lifecycle maintenance policy for patches and hotfixes
* Access to certified ecosystem content
** Learn more at https://dockr.ly/engine2 **
ACTIVATE your own engine to Docker Engine - Enterprise using:
sudo docker engine activate
root@microservicehost:~#
验证结果
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:50 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:42:13 2019
OS/Arch: linux/amd64
Experimental: false
本博客为Swagger-Ranger的笔记分享,文中源码地址: https://github.com/Swagger-Ranger
欢迎交流指正,如有侵权请联系作者确认删除: liufei32@outlook.com
posted on 2019-04-08 13:38 Swagger-Ranger 阅读(617) 评论(0) 编辑 收藏 举报