docker - install docker in ubuntu

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

 

Set up the repository

apt-get update

apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg \
    lsb-release



curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

echo \
  "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null



Install Docker Engine

apt-get update


apt-get install docker-ce docker-ce-cli containerd.io




Verify that Docker Engine is installed correctly by running the hello-world image.

docker run hello-world

docker version

 

 




 

 

 


change cgroup driver to systemd

 

 

/lib/systemd/system/docker.service

 

 

 

修改成如下:

 

 

 

重启服务:

systemctl daemon-reload 

systemctl restart docker

 

docker info

 

 

 

 
posted @ 2021-05-29 08:58  xman888  阅读(90)  评论(0编辑  收藏  举报