CentOS7/ Ubuntu14.06/16.04 安裝docker

CentOS7安裝docker

#安裝依賴包 

yum install -y yum-utils device-mapper-persistent-data lvm2

# 添加Docker軟件包源

yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo

# 更新yum包索引

yum makecache fast

# 安裝Docker CE

 

yum install docker-ce

# 啓動

systemctl start docker

# 卸載

yum remove docker-ce
rm -rf /var/lib/docker

#查看docker版本

docker info
Ubuntu14.06/16.04

# 安裝證書

sudo apt-get install \
apt-transport-https \
a-certificates \
curl \
software-properties-common

# 添加Docker源的KEY

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

# 添加Docker軟件包源

sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"

# 更新apt包索引

sudo apt-get update

# 安裝

sudo apt-get install docker-ce

# 卸載

sudo apt-get purge docker-ce
sudo rm -rf /var/lib/docker

 


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章