ubuntu20.04/22.04/24.04 docker 容器安装方法

ubuntu20.04/22.04/24.04 docker 容器安装方法:

1 Set up Docker's apt repository.

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

# Add the repository to Apt sources:
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 update

2 To install the latest version, run:

c 复制代码
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

3 Verify that the Docker Engine installation is successful by running the hello-world image.

c 复制代码
sudo docker run hello-world

显示如下表示安装成功:

c 复制代码
Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/
相关推荐
HIT_Weston1 分钟前
32、【Ubuntu】【远程开发】内网穿透:远程主机连接
linux·运维·ubuntu
yolo_guo4 分钟前
WSL2 安装 centos6.9 子系统
linux
p666666666810 分钟前
【☀Linux驱动开发笔记☀】新字符设备驱动开发_02
linux·嵌入式硬件·学习
沐怡旸15 分钟前
【穿越Effective C++】条款22:将成员变量声明为private——封装的边界与设计的自由
c++
大聪明-PLUS17 分钟前
在 Linux 上使用实时调度策略运行应用程序
linux·嵌入式·arm·smarc
Awkwardx20 分钟前
Linux网络编程—应用层自定义协议与序列化
linux·网络
q***9941 小时前
SocketTool、串口调试助手、MQTT中间件基础
单片机·嵌入式硬件·中间件
小武~1 小时前
#嵌入式Linux电源管理实战:深入解析CPU调频governor原理与优化
linux
菜鸟-012 小时前
IAP二级启动系统
单片机·嵌入式硬件
red watchma2 小时前
向量表偏移寄存器(Vector Table Offset Register,VTOR)
单片机·嵌入式硬件