当前位置: 首页 > article >正文

ubuntu20.04/22.04/24.04 docker 容器安装方法

ubuntu20.04/22.04/24.04 docker 容器安装方法:

1 Set up Docker’s apt repository.

# 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:

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.

sudo docker run hello-world

显示如下表示安装成功:

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/

http://www.kler.cn/a/301902.html

相关文章:

  • # 第20章 Cortex-M4-触摸屏
  • Android 6年经验面试总结 2024.11.15
  • 面试时问到软件开发原则,我emo了
  • 容器安装gitlab
  • 飞凌嵌入式RK3576核心板已适配Android 14系统
  • 解决背景图因为图片路径中携带括号导致图片无法显示的问题
  • RB-SQL:利用检索LLM框架处理大型数据库和复杂多表查询的NL2SQL
  • JAVAWeb-XML-Tomcat(纯小白下载安装调试教程)-HTTP
  • 算法设计(二)
  • 【Java OJ】弦截法求根(循环)
  • 针对网上nbcio-boot代码审计的actuator方法的未授权访问漏洞和ScriptEngine的注入漏洞的补救
  • 基线代理 AI 系统架构
  • 一个以细节见功底的JAVA程序
  • MySQL——数据库的高级操作(二)用户管理(2)创建普通用户
  • 春招审核新策略:Spring Boot系统实现
  • 大型语言模型:通过代码生成、调试和 CI/CD 集成改变软件开发的游戏规则
  • 大数据新视界 --大数据大厂之Flink强势崛起:大数据新视界的璀璨明珠
  • Stable Diffusion绘画 | ControlNet应用-Tile(分块)—tile_resample(分块-重采样)
  • asio中的异步accept分析
  • 如何将 Electron 项目上架 Apple Store
  • 【时时三省】c语言例题----华为机试题<进制转换>
  • Android-10分区存储介绍及百度APP适配实践(1)
  • google vr 入门之制作简易的VR播放器(二)
  • 基于OpenCV与MQTT的停车场车牌识别系统:结合SQLite和Flask的设计流程
  • 基于Qt的自定制WPS
  • 垃圾回收