ubuntu服务器上部署项目(一)Docker

同理看一下官网文档:

https://docs.docker.com/engine/install/ubuntu/

 

 卸载旧版本。

 update: 

文档里都有,抄下来就完了。别把$也复制就行。

$ sudo apt-get update

$ sudo apt-get install 
    apt-transport-https 
    ca-certificates 
    curl 
    gnupg-agent 
    software-properties-common

中间有点激动了,点了两次y ,不过没关系。。这样就可以了。

 

 Add Docker’s official GPG key:

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

设置镜像的仓库:

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

 再更新

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

查看状态:

systemctl status docker

 

测试:

sudo docker run hello-world

@

原文地址:https://www.cnblogs.com/DarGi2019/p/13973673.html