第一章、安装Docker(官方安装)
CentOS7
# 安装依赖包 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 # 测试 docker run hello-world docker version # 卸载 yum remove docker-ce rm -rf /var/lib/docker
Ubuntu14.06/16.04
# 安装证书 $ sudo apt-get install \ apt-transport-https \ ca-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 # 安装Docker CE $ sudo apt-get install docker-ce # 测试 sudo docker run hello-world sudo docker version # 卸载Docker CE $ sudo apt-get purge docker-ce $ sudo rm -rf /var/lib/docker
文章目录
关闭