Files
nexus/wiki/sources/Ubuntu-Server-Docker安装配置.md

1.6 KiB
Raw Blame History

title, type, tags, date
title type tags date
Ubuntu Server Docker安装配置 source
Docker
Ubuntu
安装配置
2025-03-14

Source File

Summary

  • 核心主题Ubuntu Server安装Docker Engine和Docker Compose V2
  • 问题域:官方仓库安装确保版本最新
  • 方法/机制添加Docker GPG密钥 → 添加apt源 → apt install
  • 结论/价值完整的Ubuntu Docker官方安装流程

Key Claims

  • 卸载旧版for pkg in docker.io docker-engine docker-ce docker.io docker-compose docker-compose-v2; do sudo apt-get remove $pkg; done
  • 添加GPG密钥sudo install -m 0755 -d /etc/apt/keyrings && sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
  • 添加apt源echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
  • 安装sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
  • 非root用户运行sudo usermod -aG docker $USER

Key Concepts

Key Entities

Connections

Contradictions

  • 无冲突