2019独角兽企业重金招聘Python工程师标准>>>
进入docker网址 https://www.docker.com/
点击 Get Docker -> Ubuntu 就可以看到教程(下面是官网搬运过来的 -v-)
-
Setp 1:Set up the repository 将Docker添加到仓库中
Set up the Docker CE repository on Ubuntu. The lsb_release -cs sub-command prints the name of your Ubuntu version, like xenial or trusty.
sudo apt-get -y install \apt-transport-https \ca-certificates \curlcurl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -sudo add-apt-repository \"deb [arch=amd64] https://download.docker.com/linux/ubuntu \$(lsb_release -cs) \stable"sudo apt-get update
ps 其中$(lsb_release -cs) 是 ubuntu的版本号
如果用的是ubuntu16.4 则等同于 以下命令
sudo add-apt-repository \"deb [arch=amd64] https://download.docker.com/linux/ubuntu \xenial \stable"
-
Setp 2 : Get Docker CE 安装Docker社区版
Install the latest version of Docker CE on Ubuntu:
sudo apt-get -y install docker-ce
-
Setp 3 : Test your Docker CE installation 测试你的Docker
Test your installation:
sudo docker run hello-world