安装docker-ce
移除旧版本docker
sudo apt-get remove docker docker-engine docker.io
安装软件包来允许apt通过HTTPS使用存储库
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
添加Docker的官方GPG密钥
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
添加docker的下载源,因为官方还没有ubuntu18的下载源,所以先用ubuntu17(zesty)的
ubuntu14.04把zesty换成trusty,ubuntu16.04换成xenial
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu zesty stable"
安装docker-ce
sudo apt-get update
sudo apt-get install docker-ce
不使用sudo执行docker命令
创建docker组
sudo groupadd docker
将当前用户加入docker组
sudo gpasswd -a ${USER} docker
重启docker
sudo service docker restart
刷新docker组
newgrp - docker
安装docker machine
$ base=https://github.com/docker/machine/releases/download/v0.14.0 &&
curl -L $base/docker-machine-$(uname -s)-$(uname -m) >/tmp/docker-machine &&
sudo install /tmp/docker-machine /usr/local/bin/docker-machine
安装VirtualBox
编辑/etc/apt/sources.list添加这行内容:"deb https://download.virtualBox.org/virtualBox/debian bionic contrib"
wget -q https://www.virtualBox.org/download/oracle_vBox_2016.asc -O- | sudo apt-key add -
sudo apt-get update
sudo apt-get install virtualBox-5.2