linux-ubuntu下安装docker

参考文档:https://docs.docker.com/install/linux/docker-ce/ubuntu/

一、设置docker repository

1. $ sudo apt-get update

2. $ sudo apt-get install \

    apt-transport-https \

    ca-certificates \

    curl \

    gnupg-agent \

    software-properties-common

3. $ 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"

二、安装docker

1. $ sudo apt-get update

2. $ sudo apt-get install docker-ce docker-ce-cli containerd.io

3. $ sudo docker run hello-world        //运行官方image hello-world测试是否安装成功

转载于:https://www.cnblogs.com/-zyq/p/10424703.html

你可能感兴趣的:(运维)