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/
相关推荐
c2385613 分钟前
MySQL 基础用法(下):查询进阶与核心特性
android·c语言·c++·mysql
进击切图仔31 分钟前
在 windows 和 ubuntu 中配置 host 文件
linux·windows·ubuntu
JNX_SEMI34 分钟前
Hi5000Q/H 6.5~75V宽输入——与H5227A完全对等,无缝适配现有电源方案-聚能芯-智芯官方授权一级代理
驱动开发·单片机·嵌入式硬件·物联网·硬件工程
郭涤生35 分钟前
C++ 零拷贝(Zero-Copy)
linux·开发语言·c++
weixin_4454766839 分钟前
LIMS 3.0 测试环境部署过程记录
linux·状态模式
乐观勇敢坚强的老彭1 小时前
计算机内存中的堆和栈
c++
哥不想学算法1 小时前
STM32零基础教程(五):UART串口通信与协议设计
stm32·单片机·嵌入式硬件
WWJA王文举1 小时前
STM32时钟树怎么看?一步理解SYSCLK、HCLK、PCLK和外设时钟配置
stm32·单片机·嵌入式硬件
十月的皮皮1 小时前
STM32从零到量产开发:四路继电器工业控制模块开发 - 上位机操作说明书
c语言·stm32·单片机·stm32cubemx
The Chosen One9851 小时前
【操作系统】操作系统引导、虚拟机、进程通信、信号
linux·运维·服务器·操作系统·虚拟机·信号