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/
相关推荐
沐欣工作室_lvyiyi几秒前
基于单片机的两轮自平衡循迹小车(论文+源码)
单片机·嵌入式硬件·小车·两轮自平衡
清风66666620 分钟前
基于单片机的8路抢答器设计与实现
数据库·单片机·嵌入式硬件·毕业设计·课程设计·期末大作业
点灯小铭30 分钟前
基于单片机的智能污水有害气体电子鼻检测系统
数据库·单片机·嵌入式硬件·毕业设计·课程设计·期末大作业
龚礼鹏39 分钟前
Android应用程序 c/c++ 崩溃排查流程
c语言·开发语言·c++
Chennnng1 小时前
Ubuntu 安装过程的 6 大常见问题类型
linux·运维·ubuntu
阿干tkl1 小时前
传统网络与NetworkManager对比
linux·网络
Evan芙2 小时前
Linux 进程状态与进程管理命令
linux·运维·服务器
REDcker2 小时前
JS 与 C++ 语言绑定技术详解
开发语言·javascript·c++
June`2 小时前
C++11新特性全面解析(三):智能指针与死锁
开发语言·c++
码农12138号2 小时前
Bugku HackINI 2022 Whois 详解
linux·web安全·ctf·命令执行·bugku·换行符