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-engine

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

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

sudo 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-core
 sudo 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.sh
 sudo 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.sh
 sudo 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.sh
 sudo 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/docker
 sudo rm -rf /var/lib/containerd

You have to delete any edited configuration files manually.





































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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

vue3之小白入门篇

感觉vue这种东西的学习门槛不低&#xff0c;如果原来是用mvc方式编程的话。 在开始想以一个较完整的demo系统开发来学习时&#xff0c;却发现登录页面是个问题。 这是因为网上教程很少从一个小白的角度来设计思考一个完整的系统需要哪些知识&#xff0c;面临哪些问题&#xf…

python版本的Selenium的下载及chrome环境搭建和简单使用

针对Python版本的Selenium下载及Chrome环境搭建和使用&#xff0c;以下将详细阐述具体步骤&#xff1a; 一、Python版本的Selenium下载 安装Python环境&#xff1a; 确保系统上已经安装了Python 3.8及以上版本。可以从[Python官方网站]下载并安装最新版本的Python&#xff0c;…

PyCharm安装激活教程(Jetbrains其它软件可参考)

PyCharm安装激活教程 PyCharm安装激活教程1.python基础环境安装配置1.1 下载及安装 2.PyCharm安装及激活教程2.1 学生/教师安装&#xff08;有学信网/edu.cn邮箱&#xff09;及激活2.1.1 安装2.1.2 激活 2.2 非教育用户安装及激活2.2.1 安装2.2.2 激活 参考文献 PyCharm安装激活…

第 29 章 - ES 源码篇 - 网络 IO 模型及其实现概述

前言 本文介绍了 ES 使用的网络模型&#xff0c;并介绍 transport&#xff0c;http 接收、响应请求的代码入口。 网络 IO 模型 Node 在初始化的时候&#xff0c;会创建网络模块。网络模块会加载 Netty4Plugin plugin。 而后由 Netty4Plugin 创建对应的 transports&#xff0…

如何通过 Konga 可视化界面配置 Kong Key-Auth 实现Open API Key 认证

言简意赅的讲解 Konga 可视化配置 Kong Key-Auth解决的痛点 在现代微服务架构中&#xff0c;API 网关常常用于集中管理 API 的认证和授权。Kong 是一款非常流行的 API 网关&#xff0c;它提供了丰富的插件支持&#xff0c;而 Key Authentication&#xff08;Key-Auth&#xff…

C++——deque的了解和使用

目录 引言 标准库中的deque 一、deque的基本概念 二、deque的常用接口 1.deque的迭代器 2.deque的初始化 3.deque的容量操作 3.1 有效长度和容量大小 3.2 有效长度和容量操作 4.deque的访问操作 5.deque的修改操作 三、deque的应用场景 结束语 引言 在C中&#x…

使用R语言绘制交互地图

在现代地理信息系统&#xff08;GIS&#xff09;应用中&#xff0c;交互地图成为了数据展示的重要工具。相比传统的静态地图&#xff0c;交互地图不仅能够更生动地呈现空间数据&#xff0c;还能增强用户的参与感和数据探索性。本文将介绍如何使用R语言绘制交互地图&#xff0c;…

支持向量机入门指南:从原理到实践

目录 1 支持向量机的基本概念 1.2 数学表达 2 间隔与支持向量 2.1 几何间隔 2.2 支持向量的概念 2.3 规范化超平面 2.4 支持向量的深入分析 2.4.1 支持向量的特征 2.4.2 支持向量的作用 2.4.3 支持向量的代数表示 2.5 KKT条件 3 最优化问题 3.1 问题的形成 3.2 规…

【时时三省】(C语言基础)动态内存函数calloc

山不在高&#xff0c;有仙则名。水不在深&#xff0c;有龙则灵。 ----CSDN 时时三省 calloc calloc函数也用来动态内存分配 原型如下: void* calloc&#xff08;size&#xff3f;t num, size&#xff3f;t size&#xff09;&#xff1b; 它们两个的区别是 它是需要两个参数…

Flutter中添加全局防护水印的实现

随着版权意识的加强&#xff0c;越来越多的应用开始在应用内部增加各种各样的水印信息&#xff0c;防止核心信息泄露&#xff0c;便于朔源。 效果如下&#xff1a; 在Flutter中增加全局水印的方式&#xff0c;目前有两种实现。 方案一&#xff0c;在native层添加一个遮罩层&a…

uniapp - 小程序实现摄像头拍照 + 水印绘制 + 反转摄像头 + 拍之前显示时间+地点 + 图片上传到阿里云服务器

前言 uniapp&#xff0c;碰到新需求&#xff0c;反转摄像头&#xff0c;需要在打卡的时候对上传图片加上水印&#xff0c;拍照前就显示当前时间日期地点&#xff0c;拍摄后在呈现刚才拍摄的图加上水印&#xff0c;最好还需要将图片上传到阿里云。 声明 水印部分代码是借鉴的…

图像处理-Ch7-小波函数

个人博客&#xff01;无广告观看&#xff0c;因为这节内容太多了&#xff0c;有点放不下&#xff0c;分了三节 文章目录 多分辨率展开(Multi-resolution Expansions)序列展开(Series Expansions)尺度函数(Scaling Function)例&#xff1a;哈尔尺度函数(Haar scaling func)多分…

本地小主机安装HomeAssistant开源智能家居平台打造个人AI管家

文章目录 前言1. 添加镜像源2. 部署HomeAssistant3. HA系统初始化配置4. HA系统添加智能设备4.1 添加已发现的设备4.2 添加HACS插件安装设备 5. 安装cpolar内网穿透5.1 配置HA公网地址 6. 配置固定公网地址 前言 大家好&#xff01;今天我要向大家展示如何将一台迷你的香橙派Z…

Rocky Linux下安装meld

背景介绍&#xff1a; meld是一款Linux系统下的用于 文件夹和文件的比对软件&#xff0c;非常常用&#xff1b; 故障现象&#xff1a; 输入安装命令后&#xff0c;sudo yum install meld&#xff0c;报错。 12-31 22:12:17 ~]$ sudo yum install meld Last metadata expirat…

数据结构与算法之动态规划: LeetCode 337. 打家劫舍 III (Ts版)

打家劫舍 III https://leetcode.cn/problems/house-robber-iii/description/ 描述 小偷又发现了一个新的可行窃的地区。这个地区只有一个入口&#xff0c;我们称之为 root除了 root 之外&#xff0c;每栋房子有且只有一个“父“房子与之相连一番侦察之后&#xff0c;聪明的小…

chatwoot 开源客服系统搭建

1. 准备开源客服系统&#xff08;我是用的Chatwoot &#xff09; 可以选择以下开源客服系统作为基础&#xff1a; Chatwoot: 功能强大&#xff0c;支持多渠道客户对接&#xff0c;&#xff08;支持app&#xff0c;web&#xff09;。Zammad: 现代的开源工单系统。FreeScout: 免…

sentinel-请求限流、线程隔离、本地回调、熔断

请求限流&#xff1a;控制QPS来达到限流的目的 线程隔离&#xff1a;控制线程数量来达到限流的目录 本地回调&#xff1a;当线程被限流、隔离、熔断之后、就不会发起远程调用、而是使用本地已经准备好的回调去提醒用户 服务熔断&#xff1a;熔断也叫断路器&#xff0c;当失败、…

鸿蒙开发-ArkTS中使用Path组件

在ArkTS中使用Path组件&#xff0c;可以按照以下步骤进行&#xff1a; 一、了解Path组件 Path组件用于根据绘制路径生成封闭的自定义形状。该组件从API Version 7开始支持&#xff0c;并随着后续版本的更新可能增加新的功能。Path组件支持多种属性和方法&#xff0c;用于定义…

高效管理 Nginx 的利器:nginxWebUI 指南和 Docker 部署安装过程

前言 Nginx WebUI 是一个为 Nginx 提供图形化管理界面的工具。通过 WebUI&#xff0c;用户可以轻松管理 Nginx 配置&#xff0c;而无需直接编辑配置文件&#xff0c;尤其适合新手用户和频繁修改配置的场景。 官网文档&#xff1a;nginxWebUI - 文档 本文将分享为什么选择 ngin…

Linux网络 | 理解Web路径 以及 实现一个简单的helloworld网页

前言&#xff1a;本节内容承接上节课的http相关的概念&#xff0c; 主要是实现一个简单的接收http协议请求的服务。这个程序对于我们理解后面的http协议的格式&#xff0c;报头以及网络上的资源的理解&#xff0c; 以及本节web路径等等都有着重要作用。 可以说我们就用代码来理…