快速在Linux上安装Docker

本例在CentOS 7上演示

本着 偷懒 的原则快速安装docker
找到了官方安装脚本
一键解决

  • 安装
1
# wget -qO- get.docker.com | bash

如果没有wget先用yum装一下

  • 启动docker服务
1
# systemctl start docker
  • 设置开机启动
1
# systemctl enable docker
  • 现在可以测试一下
1
# docker run hello-world

输出

1
2
3
4
5
6
7
8
9
10
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
d1725b59e92d: Pull complete
Digest: sha256:0add3ace90ecb4adbf7777e9aacf18357296e799f81cabc9fde470971e499788
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

...

这样就是快速安装docker的过程了 :P

Enjoy it!

END