准备工作
- 下载ubuntu-16.04.2-desktop-amd64.ios镜像
- Oracle VM VirtualBox 安装ios镜像
开始安装
- 获取最新的安装包
wget -qO- https://get.docker.com/ | sh
- 安装完成后有个提示:
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 runoob
Remember that you will have to log out and back in for this to take effect!
-
当要以非root用户可以直接运行docker时,需要执行
sudo usermod -aG docker runoob
命令,然后重新登陆 -
配置阿里云加速镜像
echo "DOCKER_OPTS=\"--registry-mirror=https://jjvitjcg.mirror.aliyuncs.com\"" | sudo tee -a /etc/default/docker
sudo service docker restart
- 修改host
sudo -i vi /etc/resole.conf
nameserver 8.8.8.8
- 拉取hello world镜像
docker run hello-world
docker images # 可以看到相应的镜像
网友评论