docker安装和换源

安装:

https://www.runoob.com/docker/ubuntu-docker-install.html

bash 复制代码
sudo apt-get remove docker docker-engine docker.io containerd runc



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


curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc

echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/ \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

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

apt-cache madison docker-ce

sudo apt-get install docker-ce=VERSION_STRING docker-ce-cli=VERSION_STRING containerd.io


sudo docker run hello-world

换源:

注意,因为初始的域名不可访问,所有代理没有效果,只能换源!

bash 复制代码
{
  "builder": {
    "gc": {
      "defaultKeepStorage": "20GB",
      "enabled": true
    }
  },
  "experimental": false,
  "registry-mirrors": [
    "https://docker.hpcloud.cloud",
    "https://docker.m.daocloud.io",
    "https://docker.unsee.tech",
    "https://docker.1panel.live",
    "http://mirrors.ustc.edu.cn",
    "https://docker.chenby.cn",
    "http://mirror.azure.cn",
    "https://dockerpull.org",
    "https://dockerhub.icu",
    "https://hub.rat.dev"
  ]
}
相关推荐
muyun28002 天前
Docker 下部署 Elasticsearch 8 并集成 Kibana 和 IK 分词器
elasticsearch·docker·容器
傻傻虎虎2 天前
【Docker】常用帮忙、镜像、容器、其他命令合集(2)
运维·docker·容器
2401_897930063 天前
使用Docker轻松部署Neo4j图数据库
数据库·docker·neo4j
LeeZhao@3 天前
【AI推理部署】Docker篇04—Docker自动构建镜像
人工智能·docker·容器
程思扬3 天前
利用JSONCrack与cpolar提升数据可视化及跨团队协作效率
网络·人工智能·经验分享·docker·信息可视化·容器·架构
落日漫游3 天前
dockercompose和k8s区别
docker·kubernetes
lllsure3 天前
【Docker】存储卷
运维·docker·容器
纤瘦的鲸鱼3 天前
Docker 从入门到实践:容器化技术核心指南
java·docker·容器
邂逅星河浪漫3 天前
【Docker+Nginx+Ollama】前后端分离式项目部署(传统打包方式)
java·nginx·docker·部署
咖啡Beans3 天前
Docker安装ELK(Elasticsearch + Logstash + Kibana)
后端·elasticsearch·docker