docker安装和使用

docker安装:

sudo apt install apt-transport-https ca-certificates curl software-properties-common
sudo curl -fsSL https://mirrors.aliyun.com/docker-ce/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://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get install docker-ce docker-ce-cli containerd.io
docker -v
sudo usermod -aG docker slam

sudo gpasswd -a $USER docker 
newgrp docker

 

docker源设置:

sudo vim /etc/docker/daemon.json

{
  "registry-mirrors": [
        "https://docker.1panel.live",
        "https://hub.rat.dev",
        "https://docker.registry.cyou",
        "https://docker.chenby.cn",
        "https://docker.actima.top",
        "https://dockerhub.icu",
        "https://atomhub.openatom.cn",
        "https://docker.m.daocloud.io",
        "https://dockerproxy.cn",
        "https://dockerpull.com"
  ]
}

 

1.

docker images

执行 可以查询拉下来的镜像:

2.

 

posted @ 2024-08-30 18:36  dsfsadfdgd  阅读(8)  评论(0编辑  收藏  举报