Ubuntu、centos系统下安装 Docker

Ubuntu 中安装 Docker
在终端中运行下面的命令安装 Docker

    sudo apt-get update
    sudo apt-get install -y \
    apt-transport-https \
    a-certificates \
curl \
software-properties-common
    curl -fsSL https://download.daocloud.io/docker/linux/ubuntu/gpg | sudo apt-key add -
    sudo add-apt-repository \
            "deb [arch=$(dpkg --print-architecture)] https://download.daocloud.io/docker/linux/ubuntu \
            $(lsb_release -cs) \
    stable"
    sudo apt-get update
    sudo apt-get install -y -q docker-ce=*
    sudo service docker start
    sudo service docker status

在 CentOS中安装 Docker
在终端中运行命令安装 Docker。

    sudo yum install -y yum-utils
    sudo yum-config-manager \
--add-repo \
https://download.daocloud.io/docker/linux/centos/docker-ce.repo
    sudo yum install -y -q  docker-ce-.ce* docker-ce-selinux-.ce*
    sudo systemctl enable docker
    sudo systemctl start docker
    sudo service docker status

猜你喜欢

转载自blog.51cto.com/11353391/2484621