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.rhkb.cn/news/500494.html

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

相关文章

攻防世界web第六题upload1

这是题目&#xff0c;可以看出是个上传文件的题目&#xff0c;考虑文件上传漏洞&#xff0c;先随便上传一个文件试试&#xff0c;要求上传的是图片。 可以看到上传成功。 考虑用一句话木马解决&#xff0c;构造文件并修改后缀为jpg,然后上传。 <?php eval($_POST[attack])…

python数据分析:使用pandas库读取和编辑Excel表

使用 Pandas&#xff0c;我们可以轻松地读取和写入Excel 文件&#xff0c;之前文章我们介绍了其他多种方法。 使用前确保已经安装pandas和 openpyxl库&#xff08;默认使用该库处理Excel文件&#xff09;。没有安装的可以使用pip命令安装&#xff1a; pip install pandas ope…

SpringCloud源码分析-LoadBalancer

# 负载均衡缓存 org.springframework.cloud.loadbalancer.cache.DefaultLoadBalancerCache # 缓存服务实例提供 org.springframework.cloud.loadbalancer.core.CachingServiceInstanceListSupplier 负载均衡实例中没有机器列表时&#xff0c;都会查询一次org.springframewor…

Postman[2] 入门——界面介绍

可参考官方 文档 Postman 导航 | Postman 官方帮助文档中文版Postman 拥有各种工具、视图和控件&#xff0c;帮助你管理 API 项目。本指南是对 Postman 主要界面区域的高级概述&#xff1a;https://postman.xiniushu.com/docs/getting-started/navigating-postman 1. Header&a…

大数据技术-Hadoop(三)Mapreduce的介绍与使用

目录 一、概念和定义 二、WordCount案例 1、WordCountMapper 2、WordCountReducer 3、WordCountDriver 三、序列化 1、为什么序列化 2、为什么不用Java的序列化 3、Hadoop序列化特点&#xff1a; 4、自定义bean对象实现序列化接口&#xff08;Writable&#xff09; 4…

Python爬取城市天气信息,并存储到csv文件中

1.爬取的网址为&#xff1a;天气网 (weather.com.cn) 2.需要建立Weather.txt文件&#xff0c;并在里面加入如下形式的字段&#xff1a; 101120701济宁 101010100北京 3.代码运行后&#xff0c;在命令行输入Weather.txt文件中添加过的城市&#xff0c;如&#xff1a;济宁。 …

CentOS Stream 9 安装 JDK

安装前检查 java --version注&#xff1a;此时说明已安装过JDK&#xff0c;否则为未安装。如若已安装过JDK可以跳过安装步骤直接使用&#xff0c;或者先卸载已安装的JDK版本重新安装。 安装JDK 官网下载地址&#xff1a;https://www.oracle.com/java/technologies/downloads…

win11 vs2022 opencv 4.10使用vs Image Watch插件实时可视化内存mat对象

这个本来是非开源工业软件HALCON的一个功能&#xff0c;方便提升图像识别开发效率。原以为opencv没有&#xff0c;需要通过进程间共享内存的方式去实现。 结果在官网帮助文档中发现已经提供了。 opencv 4.10帮助文档https://docs.opencv.org/4.10.0/index.htmlOpenCV Tutorial…

C#Halcon深度学习预热与否的运行时间测试

在深度学习推理应用阶段&#xff0c;涉及到提速&#xff0c;绕不开一个关键词“预热”。 在其他地方的“预热”&#xff0c;预先加热到指定的温度。通常指预习准备做某一样事时&#xff0c;为此做好准备。 而在深度学习推理应用阶段涉及的预热通常是指GPU预热&#xff0c;GPU在…

STM32-笔记18-呼吸灯

1、实验目的 使用定时器 4 通道 3 生成 PWM 波控制 LED1 &#xff0c;实现呼吸灯效果。 频率&#xff1a;2kHz&#xff0c;PSC71&#xff0c;ARR499 利用定时器溢出公式 周期等于频率的倒数。故Tout 1/2KHZ&#xff1b;Ft 72MHZ PSC71&#xff08;喜欢设置成Ft的倍数&…

OCR实践-问卷表格统计

前言 书接上文 OCR实践—PaddleOCROCR实践-Table-Transformer 本项目代码已开源 放在 Github上&#xff0c;欢迎参考使用&#xff0c;Star https://github.com/caibucai22/TableAnalysisTool 主要功能说明&#xff1a;对手动拍照的问卷图片进行统计分数&#xff08;对应分数…

使用pandas把数据库中的数据转成csv文件

使用pandas把数据库中的数据转成csv文件 1、效果图 2、流程 1、连接数据库,获取数据 2、把一些中文字符转成gbk,忽略掉无法转化的 3、把数据转成csv 3、代码 import pymysql import pandas as pddef get_database(databasename):

windows下vscode使用msvc编译器出现中文乱码

文章目录 [toc]1、概述2、修改已创建文件编码3、修改vscode默认编码 更多精彩内容&#x1f449;内容导航 &#x1f448;&#x1f449;C &#x1f448;&#x1f449;开发工具 &#x1f448; 1、概述 在使用MSVC编译器时&#xff0c;出现中文报错的问题可能与编码格式有关。UTF-…

传统听写与大模型听写比对

在快节奏的现代生活中&#xff0c;听写技能仍然是学习语言和提升认知能力的重要环节。然而&#xff0c;传统的听写练习往往枯燥乏味&#xff0c;且效率不高。现在&#xff0c;随着人工智能技术的发展&#xff0c;大模型听写工具的问世&#xff0c;为传统听写带来了革命性的变革…

前端页面上传文件:解决 ERR_UPLOAD_FILE_CHANGED

文章目录 引言I 问题 ERR_UPLOAD_FILE_CHANGED问题重现步骤原因II 解决方法将文件转换为base64再转回file检测文件内容是否发生变更III 知识扩展发送一个包含文件和文本的multipart/form-data请求签名优化引言 文件上传应用场景:船舶设备的新增导入(基础信息:出厂编号)船舶…

图文教程:使用PowerDesigner导出数据库表结构为Word/Html文档

1、第一种情况-无数据库表&#xff0c;但有数据模型 1.1 使用PowerDesigner已完成数据建模 您已经使用PowerDesigner完成数据库建模&#xff0c;如下图&#xff1a; 1.2 Report配置和导出 1、点击&#xff1a;Report->Reports&#xff0c;如下图&#xff1a; 2、点击&…

vscode 多项目冲突:进行 vscode 工作区配置

问题&#xff1a;多个项目&#xff0c;每次打开会因为配置问题/包版本冲突&#xff0c;花费过长时间。 解决&#xff1a;可以通过启用工作区&#xff0c;使得各个项目的开发环境隔离。 vscode官网 对此有两种方法&#xff1a;方法一&#xff1a;启用工作区&#xff08;workspa…

试用ChatGPT的copilot编写一个程序从笔记本电脑获取语音输入和图像输入并调用开源大模型进行解析

借助copilot写代码和自己手写代码的开发过程是一样的。 首先要有明确的开发需求&#xff0c;开发需求越详细&#xff0c;copilot写出的代码才能越符合我们的预期。 其次&#xff0c;有了明确的需求&#xff0c;最好先做下需求拆解&#xff0c;特别是对于比较复杂的应用&#xf…

快速掌握Elasticsearch检索之二:滚动查询(scrool)获取全量数据(golang)

Elasticsearch8.17.0在mac上的安装 Kibana8.17.0在mac上的安装 Elasticsearch检索方案之一&#xff1a;使用fromsize实现分页 1、滚动查询的使用场景 滚动查询区别于上一篇文章介绍的使用from、size分页检索&#xff0c;最大的特点是&#xff0c;它能够检索超过10000条外的…

【分布式文件存储系统Minio】2024.12保姆级教程

文章目录 1.介绍1.分布式文件系统2.基本概念 2.环境搭建1.访问网址2.账号密码都是minioadmin3.创建一个桶4.**Docker安装miniomc突破7天限制**1.拉取镜像2.运行容器3.进行配置1.格式2.具体配置 4.查看桶5.给桶开放权限 3.搭建minio模块1.创建一个oss模块1.在sun-common下创建2.…