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/
相关推荐
笨笨饿38 分钟前
#79_NOP()嵌入式C语言中内联汇编宏的抽象封装模式研究
linux·c语言·网络·驱动开发·算法·硬件工程·个人开发
fish_xk1 小时前
Linux的权限
linux·运维·服务器
weixin_421725261 小时前
C语言中volatile关键字怎么用C语言volatile在多线程中的作用
c语言·数据结构·运算符优先级·变量命名·volatile关键字
星河耀银海1 小时前
C语言与数据库交互:SQLite实战与数据持久化
c语言·数据库·sqlite·交互
Deitymoon1 小时前
STM32F103——超声波模块
stm32·单片机·嵌入式硬件
wxin_VXbishe1 小时前
springboot新能源车充电站管理系统小程序-计算机毕业设计源码29213
java·c++·spring boot·python·spring·django·php
嵌入式×边缘AI:打怪升级日志2 小时前
Linux 驱动与应用开发核心自测题库(面试官问答完整版)
linux·运维·php
05候补工程师3 小时前
【408 从零到一】线性表逻辑特征、存储结构对比与 C/C++ 动态内存分配避坑指南
c语言·开发语言·数据结构·c++·考研
傻瓜搬砖人3 小时前
第五章习题
c语言·谭浩强·绿皮书第三版
华清远见成都中心3 小时前
C 语言内存管理深度解析:malloc/free 与嵌入式堆栈分配策略
java·c语言·算法