linux 快速安装docker
文档说明:只记录关键地方;
试验环境: linux debian 11
目标:debian或者ubuntu 快速使用上docker
一条命令安装
curl -fsSL https://get.docker.com -o get-docker.sh sh get-docker.sh # 使用阿里云镜像源 # sh get-docker.sh --mirror Aliyun # 直接使用github 仓库源码 curl -fsSL https://github.com/docker/docker-install/blob/master/install.sh?raw=true | bash -s -- --mirror Aliyun
手动配置
#!/bin/bash # https://www.ruanyifeng.com/blog/2017/11/bash-set.html set -eux set -o pipefail # https://mirrors.tuna.tsinghua.edu.cn/help/docker-ce/ # https://docs.docker.com/engine/install/debian/ # https://developer.aliyun.com/mirror/docker-ce/ __DIR__=$(cd "$(dirname "$0")";pwd) cd ${__DIR__} apt update -y # step 1: 安装必要的一些系统工具 apt install -y ca-certificates curl gnupg gnupg2 gnupg1 lvm2 lsb-release apt-transport-https curl sudo mkdir -p /etc/apt/keyrings # step 2: 安装GPG证书 curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg # Step 3: 写入软件源信息 test -f /etc/apt/sources.list.d/docker.list && rm -rf /etc/apt/sources.list.d/docker.list echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/debian \ $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null # Step 4: 更新并安装Docker-CE apt update -y apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
参考文档
- debian docker
- docker-ce | 镜像站使用帮助 | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror
- Docker CE 源使用帮助 — USTC Mirror Help 文档
- docker-ce镜像_docker-ce下载地址_docker-ce安装教程-阿里巴巴开源镜像站
- Docker Desktop on Mac
- Docker Desktop on Windows
- shell之变量默认值
- Dockerfile
- Compose file
- multistage-build
- dockerfile mount type 挂载目录
- dockerfiles-now-support-multiple-build-contexts
- 自建拉取registry.k8s.io、k8s.gcr.io、gcr.io、quay.io、ghcr.io 容器镜像的服务
- pdoman-desktop
- Docker+Wasm
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 提示词工程——AI应用必不可少的技术