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/
相关推荐
xyx-3v8 分钟前
VS CodeC51 单片机开发环境搭建
单片机·嵌入式硬件
牧以南歌〆2 小时前
在Ubuntu主机中修改ARM Linux开发板的根文件系统
linux·arm开发·驱动开发·ubuntu
jz_ddk3 小时前
[学习] C语言数学库函数背后的故事:`double erf(double x)`
c语言·开发语言·学习
lingzhilab3 小时前
零知开源——STM32F4结合BMP581气压传感器实现ST7789中文显示教程
stm32·单片机·嵌入式硬件
xiaolang_8616_wjl3 小时前
c++文字游戏_闯关打怪2.0(开源)
开发语言·c++·开源
夜月yeyue3 小时前
设计模式分析
linux·c++·stm32·单片机·嵌入式硬件
kfepiza4 小时前
Debian的`/etc/network/interfaces`的`allow-hotplug`和`auto`对比讲解 笔记250704
linux·服务器·网络·笔记·debian
无小道4 小时前
c++-引用(包括完美转发,移动构造,万能引用)
c语言·开发语言·汇编·c++
猫猫的小茶馆4 小时前
【STM32】外部中断
stm32·单片机·嵌入式硬件·mcu·51单片机
cuijiecheng20185 小时前
Ubuntu下布署mediasoup-demo
linux·运维·ubuntu