Ubuntu20.04操作系统安装Docker

1、添加Docker仓库

bash 复制代码
curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add -

 sudo add-apt-repository \
   "deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/ \
  $(lsb_release -cs) \
  stable"

2、安装Docker

bash 复制代码
sudo apt-get install docker-ce docker-ce-cli containerd.io -y

3、添加配置Docker镜像

bash 复制代码
cat <<EOF | tee /etc/docker/daemon.json
{
  "exec-opts": ["native.cgroupdriver=systemd"],
  "registry-mirrors": ["https://aoewjvel.mirror.aliyuncs.com"],
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "100m"
  },
  "storage-driver": "overlay2"
}
EOF

4、启动Docker && 加入开机自启动

bash 复制代码
mkdir -p /etc/systemd/system/docker.service.d
systemctl daemon-reload
systemctl restart docker
systemctl enable --now docker
systemctl status docker
相关推荐
马达加斯加D2 小时前
k8s --- Intro
云原生·容器·kubernetes
Gauss松鼠会3 小时前
【openGauss】构建一个兼容Oracle模式支持创建package的openGauss的docker镜像
数据库·docker·oracle·opengauss
梁正雄5 小时前
16、Docker swarm-3
运维·docker·容器
Freshman小白6 小时前
python算法打包为docker镜像(边缘端api服务)
python·算法·docker
麦兜*6 小时前
Spring Boot 应用 Docker 监控:Prometheus + Grafana 全方位监控
spring boot·后端·spring cloud·docker·prometheus
爱吃糖的小秦同学6 小时前
Docker爆红且安装非C盘处理方案
运维·docker·容器
森G6 小时前
四、Linux设备驱动介绍
linux·arm开发·ubuntu
!chen6 小时前
k8s-应用部署和组件及常用命令
云原生·容器·kubernetes
亿牛云爬虫专家8 小时前
用 Playwright + 容器化做分布式浏览器栈:调度、会话管理与资源回收
分布式·docker·容器·浏览器·爬虫代理·新闻网站·playwright
tnan25228 小时前
基于阿里云效实现cicd记录
阿里云·ci/cd·docker·容器·自动化