Ubuntu 22.04 安装 Docker Engine

Install Docker Engine on Ubuntu | Docker Docs

比较方便的安装方式为通过 Apt Repo 来安装,需要三大步:

  1. 预备仓库信息:

逐行执行一下命令

复制代码
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

# Add the repository to Apt sources:
echo \
  "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] 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 update
  1. 安装Docker Engine

    sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

  1. 下载 docker image

    sudo docker pull ubuntu

    sudo docker pull socalucr/gpgpu-sim

  2. 测试

    sudo docker run --name=ubuntu_hello2 -it ubuntu:latest /bin/bash

exit 退出

相关推荐
sulikey1 小时前
个人Linux操作系统学习笔记2 - gcc与库的理解
linux·笔记·学习·操作系统·gcc·
二宝哥2 小时前
Linux虚拟机网络配置
linux·运维·服务器
卧室小白2 小时前
docker网络与服务编排与集群
运维·docker·容器
陳10302 小时前
Linux:进程间通信 和 简单进程池
linux·运维·服务器
jimy12 小时前
改.bashrc,直观地判断本地repo是否有改动
linux·服务器
愚昧之山绝望之谷开悟之坡2 小时前
什么是Linter?什么是沙箱!
linux·笔记
babytiger3 小时前
Gitea 重安装 + Snap 数据迁移完整流程总结
linux·elasticsearch·gitea
匆匆那年9673 小时前
远程 Linux 校园网认证操作手册(本地浏览器法)
linux·运维·服务器
newnazi4 小时前
RedHat10 安装MS SQL Server2025
linux·服务器·数据库
借你耳朵说爱你4 小时前
docker容器启动报错:library initialization failed - unable to allocate file descriptor table - out of memory
docker