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/
相关推荐
国科安芯3 分钟前
抗辐照MCU芯片在激光雷达领域的适配性分析
网络·人工智能·单片机·嵌入式硬件·fpga开发
2301_8079973817 分钟前
代码随想录-day26
数据结构·c++·算法·leetcode
闭着眼睛学算法26 分钟前
【双机位A卷】华为OD笔试之【排序】双机位A-银行插队【Py/Java/C++/C/JS/Go六种语言】【欧弟算法】全网注释最详细分类最全的华子OD真题题解
java·c语言·javascript·c++·python·算法·华为od
小欣加油28 分钟前
leetcode 3318 计算子数组的x-sum I
c++·算法·leetcode·职场和发展
日更嵌入式的打工仔36 分钟前
<RT1176系列14>CCM(Clock Controller Module)解读
单片机·嵌入式硬件
云山工作室40 分钟前
基于单片机的环境监测智能报警系统的设计(论文+源码)
stm32·单片机·嵌入式硬件·毕业设计·毕设
齐落山大勇1 小时前
STM32的串口(上位机控制下位机)
stm32·单片机·嵌入式硬件
nono牛1 小时前
MTK平台详解`adb devices`输出的序列号组成
android·linux·adb·智能手机
j_xxx404_1 小时前
C++ STL:list|了解list|相关接口|相关操作
开发语言·c++
m0_598250002 小时前
电源完整性07-如何确定PDN网络中的大电容
笔记·单片机·嵌入式硬件·硬件工程