Docker安裝
一、卸載舊版本
$ sudo apt-get remove docker docker-engine docker.io
二萄窜、安裝Docker CE(社區(qū)版)
1.更新apt包
$ sudo apt-get update
2.安裝依賴庫
$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
3.添加官方GPG key
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
4.添加倉庫
$ sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
5. 安裝docker
$ sudo apt-get update
$ sudo apt-get install docker-ce
三、驗證安裝是否成功
$ sudo docker run hello-world
四、Docker卸載
1.卸載docker-ce
$ sudo apt-get purge docker-ce
2.移除docker配置文件與鏡像等
$ sudo rm -rf /var/lib/docker
五、以非root權(quán)限用戶啟動
$ sudo groupadd docker
$ sudo usermod -aG docker $USER
然后就可以不用root啟動了
$ docker run hello-world
六主卫、查看Docker版本信息
$ docker --version
Docker version 17.12.0-ce, build c97c6d6
Run docker info or (docker version without --) to view even more details about your docker installation:
$ docker info # 或者docker version
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 17.12.0-ce
Storage Driver: overlay2
...