Fedora安装docker

Install Docker Engine on Fedora https://docs.docker.com/engine/install/fedora/

  1. 更新系统

首先,更新你的系统以确保所有软件包都是最新的:

sudo dnf update -y
  1. 安装必要的依赖

安装一些必要的工具和库,如yum-utils,这将帮助我们添加Docker的官方仓库:

sudo dnf install -y yum-utils
  1. 添加Docker的官方仓库

接下来,设置稳定版的Docker仓库:

sudo yum-config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
  1. 安装Docker Engine

现在可以从Docker的仓库中安装Docker引擎:

sudo dnf install docker-ce docker-ce-cli containerd.io
  1. 启动并启用Docker服务

安装完成后,启动Docker守护进程,并设置为开机自启:

sudo systemctl start docker
sudo systemctl enable docker

可写为:

sudo systemctl enable --now docker
  1. 验证安装

最后,验证Docker是否正确安装并运行:

sudo docker run hello-world

如果一切正常,你应该会看到一条消息,说明Docker成功安装并且可以正常工作。

  1. (可选) 管理Docker作为非root用户

如果你不想每次运行Docker命令时都使用sudo,你可以将你的用户添加到docker组中:

sudo usermod -aG docker $USER

然后注销并重新登录,使新的组成员身份生效。







docker.com官网的 Fedora41,40 安装docker

sudo dnf remove docker \docker-client \docker-client-latest \docker-common \docker-latest \docker-latest-logrotate \docker-logrotate \docker-selinux \docker-engine-selinux \docker-enginesudo dnf -y install dnf-plugins-core
sudo dnf-3 config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.reposudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-pluginsudo systemctl enable --now docker

https://docs.docker.com/engine/install/fedora/ 2024年12月时的内容

Install Docker Engine on Fedora

To get started with Docker Engine on Fedora, make sure you meet the prerequisites, and then follow the installation steps.

Prerequisites

OS requirements
To install Docker Engine, you need a maintained version of one of the following Fedora versions:

  • Fedora 40
  • Fedora 41

Uninstall old versions
Before you can install Docker Engine, you need to uninstall any conflicting packages.

Your Linux distribution may provide unofficial Docker packages, which may conflict with the official packages provided by Docker. You must uninstall these packages before you install the official version of Docker Engine.

 sudo dnf remove docker \docker-client \docker-client-latest \docker-common \docker-latest \docker-latest-logrotate \docker-logrotate \docker-selinux \docker-engine-selinux \docker-engine

dnf might report that you have none of these packages installed.

Images, containers, volumes, and networks stored in /var/lib/docker/ aren’t automatically removed when you uninstall Docker.

Installation methods
  • You can install Docker Engine in different ways, depending on your needs:

  • You can set up Docker’s repositories and install from them, for ease of installation and upgrade tasks. This is the recommended approach.

  • You can download the RPM package, install it manually, and manage upgrades completely manually. This is useful in situations such as installing Docker on air-gapped systems with no access to the internet.

In testing and development environments, you can use automated convenience scripts to install Docker.

Install using the rpm repository
Before you install Docker Engine for the first time on a new host machine, you need to set up the Docker repository. Afterward, you can install and update Docker from the repository.

Set up the repository
Install the dnf-plugins-core package (which provides the commands to manage your DNF repositories) and set up the repository.

 sudo dnf -y install dnf-plugins-coresudo dnf-3 config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo

Install Docker Engine

  1. Install the Docker packages.

Latest Specific version
To install the latest version, run:

 sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

If prompted to accept the GPG key, verify that the fingerprint matches 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35, and if so, accept it.

This command installs Docker, but it doesn’t start Docker. It also creates a docker group, however, it doesn’t add any users to the group by default.

  1. Start Docker Engine.
 sudo systemctl enable --now docker

This configures the Docker systemd service to start automatically when you boot your system. If you don’t want Docker to start automatically, use sudo systemctl start docker instead.

  1. Verify that the installation is successful by running the hello-world image:
 sudo docker run hello-world

This command downloads a test image and runs it in a container. When the container runs, it prints a confirmation message and exits.

You have now successfully installed and started Docker Engine.

Tip

Receiving errors when trying to run without root?

The docker user group exists but contains no users, which is why you’re required to use sudo to run Docker commands. Continue to Linux postinstall to allow non-privileged users to run Docker commands and for other optional configuration steps.

Upgrade Docker Engine
To upgrade Docker Engine, follow the installation instructions, choosing the new version you want to install.

Install from a package
If you can’t use Docker’s rpm repository to install Docker Engine, you can download the .rpm file for your release and install it manually. You need to download a new file each time you want to upgrade Docker Engine.

  1. Go to https://download.docker.com/linux/fedora/ and choose your version of Fedora. Then browse to x86_64/stable/Packages/ and download the .rpm file for the Docker version you want to install.

  2. Install Docker Engine, changing the following path to the path where you downloaded the Docker package.

 sudo dnf install /path/to/package.rpm

Docker is installed but not started. The docker group is created, but no users are added to the group.

  1. Start Docker Engine.
 sudo systemctl enable --now docker

This configures the Docker systemd service to start automatically when you boot your system. If you don’t want Docker to start automatically, use sudo systemctl start docker instead.

  1. Verify that the installation is successful by running the hello-world image:
 sudo docker run hello-world

This command downloads a test image and runs it in a container. When the container runs, it prints a confirmation message and exits.

You have now successfully installed and started Docker Engine.

Tip

Receiving errors when trying to run without root?

The docker user group exists but contains no users, which is why you’re required to use sudo to run Docker commands. Continue to Linux postinstall to allow non-privileged users to run Docker commands and for other optional configuration steps.

Upgrade Docker Engine
To upgrade Docker Engine, download the newer package files and repeat the installation procedure, using dnf upgrade instead of dnf install, and point to the new files.

Install using the convenience script
Docker provides a convenience script at https://get.docker.com/ to install Docker into development environments non-interactively. The convenience script isn’t recommended for production environments, but it’s useful for creating a provisioning script tailored to your needs. Also refer to the install using the repository steps to learn about installation steps to install using the package repository. The source code for the script is open source, and you can find it in the docker-install repository on GitHub.

Always examine scripts downloaded from the internet before running them locally. Before installing, make yourself familiar with potential risks and limitations of the convenience script:

  • The script requires root or sudo privileges to run.
  • The script attempts to detect your Linux distribution and version and configure your package management system for you.
  • The script doesn’t allow you to customize most installation parameters.
  • The script installs dependencies and recommendations without asking for confirmation. This may install a large number of packages, depending on the current configuration of your host machine.
  • By default, the script installs the latest stable release of Docker, containerd, and runc. When using this script to provision a machine, this may result in unexpected major version upgrades of Docker. Always test upgrades in a test environment before deploying to your production systems.
  • The script isn’t designed to upgrade an existing Docker installation. When using the script to update an existing installation, dependencies may not be updated to the expected version, resulting in outdated versions.
    Tip

Preview script steps before running. You can run the script with the --dry-run option to learn what steps the script will run when invoked:

 curl -fsSL https://get.docker.com -o get-docker.shsudo sh ./get-docker.sh --dry-run

This example downloads the script from https://get.docker.com/ and runs it to install the latest stable release of Docker on Linux:

 curl -fsSL https://get.docker.com -o get-docker.shsudo sh get-docker.sh
Executing docker install script, commit: 7cae5f8b0decc17d6571f9f52eb840fbc13b2737
<...>

You have now successfully installed and started Docker Engine. The docker service starts automatically on Debian based distributions. On RPM based distributions, such as CentOS, Fedora, RHEL or SLES, you need to start it manually using the appropriate systemctl or service command. As the message indicates, non-root users can’t run Docker commands by default.

Use Docker as a non-privileged user, or install in rootless mode?

The installation script requires root or sudo privileges to install
and use Docker. If you want to grant non-root users access to Docker,
refer to the post-installation steps for Linux. You can also install
Docker without root privileges, or configured to run in rootless mode.
For instructions on running Docker in rootless mode, refer to run the
Docker daemon as a non-root user (rootless mode).

Install pre-releases
Docker also provides a convenience script at https://test.docker.com/ to install pre-releases of Docker on Linux. This script is equal to the script at get.docker.com, but configures your package manager to use the test channel of the Docker package repository. The test channel includes both stable and pre-releases (beta versions, release-candidates) of Docker. Use this script to get early access to new releases, and to evaluate them in a testing environment before they’re released as stable.

To install the latest version of Docker on Linux from the test channel, run:

 curl -fsSL https://test.docker.com -o test-docker.shsudo sh test-docker.sh

Upgrade Docker after using the convenience script
If you installed Docker using the convenience script, you should upgrade Docker using your package manager directly. There’s no advantage to re-running the convenience script. Re-running it can cause issues if it attempts to re-install repositories which already exist on the host machine.

Uninstall Docker Engine

  1. Uninstall the Docker Engine, CLI, containerd, and Docker Compose packages:
 sudo dnf remove docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras
  1. Images, containers, volumes, or custom configuration files on your host aren’t automatically removed. To delete all images, containers, and volumes:
 sudo rm -rf /var/lib/dockersudo rm -rf /var/lib/containerd

You have to delete any edited configuration files manually.





































本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/pingmian/66065.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

集线器,交换机,路由器,mac地址和ip地址知识记录总结

一篇很不错的视频简介 基本功能 从使用方面来说&#xff0c;都是为了网络传输的标识&#xff0c;和机器确定访问对象 集线器、交换机和路由器 常听到路由器和集线器&#xff0c;下面是区别&#xff1a; 集线器 集线器&#xff1a;一个简单的物理扩展接口数量的物理硬件。…

跳跃表(跳表)是什么

为什么要有跳表 正常链表只能一个一个往下走但是如果我直到我的目标位置就在链表的中部但是我还得一步一步走过去很浪费时间&#xff0c;所以跳表就是在正常链表的基础上添加了多步跳跃的指针。 什么是跳表 跳表&#xff08;Skip List&#xff09;是一种概率型的数据结构&am…

【自动驾驶汽车通讯协议】RGMII通信技术详解

文章目录 0. 前言1. RGMII概述1.1 RGMII说明1.2 RGMII作用&目的 2. RGMII的发展历史2.1 MII (Media Independent Interface)2.2 GMII (Gigabit Media Independent Interface)2.3 RGMII (Reduced Gigabit Media Independent Interface) 3. 架构设计3.1 接口信号3.2 信号时序…

浏览器选中文字样式

效果 学习 Chrome: 支持 ::selection。Firefox: 支持 :-moz-selection 和 ::selection。Safari: 支持 ::selection。Internet Explorer: 支持 :-ms-selection。Microsoft Edge: 支持 ::-ms-selection 和 ::selection。 代码 <!DOCTYPE html> <html lang"en&qu…

RAG实战:本地部署ragflow+ollama(linux)

1.部署ragflow 1.1安装配置docker 因为ragflow需要诸如elasticsearch、mysql、redis等一系列三方依赖&#xff0c;所以用docker是最简便的方法。 docker安装可参考Linux安装Docker完整教程&#xff0c;安装后修改docker配置如下&#xff1a; vim /etc/docker/daemon.json {…

如何免费解锁 IPhone 网络

您是否担心 iPhone 上的网络锁定&#xff1f;如果您的 iPhone 被锁定到特定运营商&#xff0c;解锁它可以连接到不同的运营商。好吧&#xff0c;我们为您准备了一份指南。 iPhone运营商免费解锁将是小菜一碟。在我们的解锁运营商 iphone 免费指南中。我们为您提供了一份简介&am…

人工智能安全——联邦学习的安全攻击与防护

参考论文FedMDFG: Federated Learning with Multi-Gradient Descent and Fair Guidance (AAAI-2023) 背景 随着人工智能技术的飞速发展&#xff0c;隐私保护和数据安全越来越受到重视。联邦学习&#xff08;Federated Learning, FL&#xff09;作为一种分布式隐私保护的机器学…

R机器学习:神经网络算法的理解与实操,实例解析

神经网络算法是一种模仿生物神经网络&#xff08;尤其是人脑&#xff09;结构和功能的算法。它由大量相互连接的节点&#xff08;称为神经元&#xff09;组成&#xff0c;这些神经元组织成层&#xff0c;通过传递信号来处理信息。神经网络算法在机器学习、人工智能等领域中扮演…

wsl linux CUDA安装、卸载、清理、版本降级、升级过程详解

目录 1 前言2 卸载与重新安装2.1 列出所有与 CUDA 相关的包2.2 卸载 CUDA2.3 删除残留文件2.4 移除 CUDA 仓库包2.5 删除仓库目录2.6 移除所有 CUDA 相关包2.7 删除 CUDA 的优先级配置文件2.8 查看所有 APT 源中的 CUDA 条目2.9 移除或禁用不需要的 CUDA 仓库源2.10 删除所有 A…

牛客网刷题 ——C语言初阶——OR76 两个整数二进制位不同个数

1. 牛客网题目&#xff1a;OR76 两个整数二进制位不同个数 牛客网OJ链接 描述&#xff1a; 输入两个整数&#xff0c;求两个整数二进制格式有多少个位不同 输入描述&#xff1a;两个整数 输出描述&#xff1a;二进制不同位的个数 示例1 输入&#xff1a;22 33 输出&#xff1a…

【AWS SDK PHP】This operation requests `sigv4a` auth schemes 问题处理

使用AWS SDK碰到的错误&#xff0c;其实很简单&#xff0c;要装个扩展库 保持如下 Fatal error: Uncaught Aws\Auth\Exception\UnresolvedAuthSchemeException: This operation requests sigv4a auth schemes, but the client currently supports sigv4, none, bearer, sigv4-…

设计模式 结构型 装饰器模式(Decorator Pattern)与 常见技术框架应用 解析

装饰器模式&#xff08;Decorator Pattern&#xff09;&#xff0c;又称为包装器模式&#xff08;Wrapper Pattern&#xff09;&#xff0c;是一种结构型设计模式。它允许在不改变原有对象结构的基础上&#xff0c;动态地给对象添加一些新的职责&#xff08;即增加其额外功能&a…

<论文>聊聊初代LLaMA

一、摘要 本文介绍来自Meta的论文《LLaMA: Open and Efficient Foundation Language Models》&#xff0c;这篇2023年的研究发布了开源的LLaMA系列大模型&#xff0c;轰动一时。 译文&#xff1a; 我们推出了 LLaMA&#xff0c;一系列参数规模从 70 亿到 650 亿的基础语言模型。…

把vue项目或者vue组件发布成npm包或者打包成lib库文件本地使用

将vue项目发布成npm库文件&#xff0c;第三方通过npm依赖安装使用&#xff1b;使用最近公司接了一个项目&#xff0c;这个项目需要集成到第三方页面&#xff0c;在第三方页面点击项目名称&#xff0c;页面变成我们的项目页面&#xff1b;要求以npm库文件提供给他们&#xff1b;…

自从学会Git,感觉打开了一扇新大门

“同事让我用 Git 提交代码&#xff0c;我居然直接把项目文件压缩发过去了……”相信很多初学者都经历过类似的窘境。而当你真正掌握 Git 时&#xff0c;才会发现它就像一本魔法书&#xff0c;轻松解决代码管理的种种难题。 为什么 Git 能成为程序员的标配工具&#xff1f;它究…

【重庆】《政务数字化应用费用测算规范》(T/CDCIDA 001—2023)-省市费用标准解读系列36

《政务数字化应用费用测算规范&#xff08;报批稿&#xff09;》于2023年11月18日实施&#xff0c;本文件按照GB/T 1.1-2020给出的规则起草&#xff0c;主要适用于重庆政务数字化应用项目的费用测算。我司基于专业第三方信息化项目造价机构角度&#xff0c;从标准创新点、定制软…

Python | 学习type()方法动态创建类

getattr方法的使用场景是在访问不存在的属性时&#xff0c;会触发该方法中的处理逻辑。尤其是在动态属性获取中结合 type()动态创建类有着良好的使用关系。 type()方法常用来判断属性的类别&#xff0c;而动态创建类不常使用&#xff0c;通过如下的几个实例来学习使用&#xff…

机器学习之逻辑回归算法、数据标准化处理及数据预测和数据的分类结果报告

逻辑回归算法、数据标准化处理及数据预测和数据的分类结果报告 目录 逻辑回归算法、数据标准化处理及数据预测和数据的分类结果报告1 逻辑回归算法1.1 概念理解1.2 算法导入1.3 算法优缺点 2 LogisticRegression理解2.1查看参数定义2.2 参数理解2.3 方法2.4基本格式 3 数据标准…

Linux(Ubuntu24.04)源码编译安装VTK7.1.1记录

VTK&#xff08;Visualization Toolkit&#xff09;是一个开源的3D可视化开发工具包&#xff0c;用于开发可视化和图形处理应用程序。VTK提供了一系列的算法和工具&#xff0c;用于创建、渲染和处理复杂的3D图形和数据。VTK由C编写&#xff0c;并提供了Python、Java和Tcl等语言…

node.js下载、安装、设置国内镜像源(永久)(Windows11)

目录 node-v20.18.0-x64 工具下载安装设置国内镜像源&#xff08;永久&#xff09; node-v20.18.0-x64 工具 系统&#xff1a;Windows 11 下载 官网https://nodejs.org/zh-cn/download/package-manager 版本我是跟着老师选的node-v20.18.0-x64如图选择 Windows、x64、v2…