ubuntu 安装Docker 需要sudo权限。
使用
which wget 判断wget是否安装,如果没有安装使用如下命令安装wget
$ sudo apt-get update
$ sudo apt-get install wget
获取最新的Docker
$ wget -qO- https:/// | sh
提示输入 sudo密码,然后自动下载安装。
运行
sudo docker run hello-world
测试docker是否安装成功,显示如下 信息
Cannot connect to the Docker daemon. Is 'docker -d' running on this host? Docker系统没有启动成功,运行如下查看Docker启动状态,
sudo service docker status
显示如下 docker stop/waiting
启动docker,~$ sudo docker -d
INFO[0000] [graphdriver] using prior storage driver "aufs"
INFO[0000] Listening for HTTP on unix (/var/run/)
WARN[0000] Running modprobe bridge nf_nat failed with message: , error: exit status 1
WARN[0000] Your kernel does not support cgroup memory limit: mountpoint for memory not found
WARN[0000] mountpoint for cpu not found
FATA[0000] Error mounting devices cgroup: mountpoint for devices not found
为cgroup在宿主机上没有挂载。
vim /etc/fstab
none /sys/fs/cgroup cgroup defaults 0 0
重启机器即可