搜索
首页系统教程LINUXCentOS和Fedora系统使用Docker的指南

CentOS和Fedora系统使用Docker的指南

Jan 15, 2024 am 09:27 AM
centosdockerfedora

一、从docker官方yum源进行安装

1、添加docker官方源

cat >/etc/yum.repos.d/docker.repo <<-EOF
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/7
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
EOF

2、安装和启动

#安装
sudo yum install docker-engine
#启动
sudo systemctl enable docker.service
#开机启动
systemctl enable docker.service
#验证安装
sudo docker run hello-world

二、用脚本的方式安装

curl -sSL https://get.docker.com/ | sh

三、非特权用户运行 docker 命令

在 CentOS 或 Fedora 上安装完成 Docker 后,为了能以非 root 用户运行 docker,你需要把你自己添加进 docker 用户组,使用如下命令:

sudo usermod -a -G docker $USER

登出,然后再登入,以使组改变生效。
这个时候,你应该可以以一个非特权用户运行 docker 命令了。

四、使用国内源

1、安装dao

curl -sSL https://get.daocloud.io/daomonit/install.sh | sh -s 6d3f36d42ae3f3d4237943c65c8f3e5446e49a71

2、使用dao命令

dao pull ubuntu

看起来像这样:

&#10140;~dao pull ubuntu
Dao from DaoCloud
Initializing, Please wait a minute
Using default tag: latest
Pulling repository daocloud.io/daocloud/daocloud-toolset
aa5dc2eecd4a: Download complete
Status: Image is up to date for daocloud.io/daocloud/daocloud-toolset:latest
daocloud.io/daocloud/daocloud-toolset: this image was pulled from a legacy registry.Important: This registry version will not be supported in future versions of docker.
Inital Success


# ----------------------------------------------------------------------------
# DaoCloud ToolBox for Docker
#
# DaoCloud, Inc. (c) 2015
#
# Fastest way to pull image from Docker Registry
# ----------------------------------------------------------------------------

Pulling repository ubuntu
Pulling ubuntu image metadata
Pulling ubuntu:latest tag metadata
0105f98ced6d: Load layer complete
66395c31eb82: Load layer complete
002fa881df8a: Load layer complete
a005e6b7dd01: Load layer complete
Loading image to docker ...

** Pull ubuntu success. **
You can find it with 'docker images ubuntu'

其他的可以参考本站之前发布的文章

以上是CentOS和Fedora系统使用Docker的指南的详细内容。更多信息请关注PHP中文网其他相关文章!

声明
本文转载于:脚本之家。如有侵权,请联系admin@php.cn删除
Linux与Windows的典型用例是什么?Linux与Windows的典型用例是什么?May 03, 2025 am 12:01 AM

LinuxIsideAlforCustomization,开发和ServerManagement,WhileWindowSexcelSineAsofuse,SoftWareCompatibility andgaming.linuxoffershighighighighignfigurabilityfordefordeerserersandserserservervevendingservervevelicersandervervevelopservervevelopservervevelopsetups,whereaswindowspprovidesaprovidesauser-frovideslyinlyintellyintlyintellyinterfrignlyInterFaroffacorDofroardOaforportort

Linux和Windows之间的用户帐户管理有什么区别?Linux和Windows之间的用户帐户管理有什么区别?May 02, 2025 am 12:02 AM

Linux和Windows在用户账户管理上的主要区别在于权限模型和管理工具。Linux使用基于Unix的权限模型和命令行工具(如useradd、usermod、userdel),而Windows采用自己的安全模型和图形用户界面(GUI)管理工具。

Linux的命令行环境如何使其比Windows更安全?Linux的命令行环境如何使其比Windows更安全?May 01, 2025 am 12:03 AM

Linux'scommandlinecanbemoresecurethanWindowsifmanagedcorrectly,butrequiresmoreuserknowledge.1)Linux'sopen-sourcenatureallowsforquicksecurityupdates.2)Misconfigurationcanleadtovulnerabilities.Windows'commandlineismorecontrolledbutlesscustomizable,with

如何在Linux中自动制作USB驱动器安装如何在Linux中自动制作USB驱动器安装Apr 30, 2025 am 10:04 AM

本指南说明了如何在Linux的启动下自动安装USB驱动器,从而节省了时间和精力。 步骤1:确定您的USB驱动器 使用LSBLK命令列出所有块设备。 您的USB驱动器可能会标记为 /dev /sdb1, /dev /sdc1等

2025年,最佳Linux,Windows和Mac的最佳跨平台应用程序2025年,最佳Linux,Windows和Mac的最佳跨平台应用程序Apr 30, 2025 am 09:57 AM

跨平台应用程序已彻底改变了软件开发,从而在Linux,Windows和MacOS等操作系统上实现了无缝功能。 这消除了根据您的设备切换应用程序的需求,提供一致的体验

2025年AI和机器学习的最佳Linux工具2025年AI和机器学习的最佳Linux工具Apr 30, 2025 am 09:44 AM

人工智能(AI)正在迅速改变许多部门,从医疗保健和金融到艺术和音乐等创意领域。 Linux具有开源性,适应性和性能功能,已成为首要的Platfo

5最佳轻巧的Linux发行版,不带GUI5最佳轻巧的Linux发行版,不带GUIApr 30, 2025 am 09:38 AM

寻找没有图形用户界面(GUI)的快速,最小和高效的Linux分布? 轻巧,无GUI-Linux发行版非常适合较旧的硬件或服务器和嵌入式系统(例如服务器和嵌入式系统)。他们消耗较少的res

如何在Redhat发行中安装葡萄酒10.0如何在Redhat发行中安装葡萄酒10.0Apr 30, 2025 am 09:32 AM

Wine 10.0稳定版发布:在Linux上运行Windows应用更上一层楼 Wine,这款开源免费的应用程序,让Linux用户能够在Unix/Linux类操作系统上运行Windows软件和游戏,迎来了10.0稳定版的发布!此版本已提供源代码和二进制包下载,支持Linux、Windows和Mac等多种发行版。 这一版本凝聚了一年的辛勤工作和超过8600项改进,带来了诸多令人兴奋的提升。主要亮点包括: 增强对蓝牙设备的支持。 提升对HID输入设备的支持。 优化了32位和64位应用程序的运行性能。

See all articles

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

Video Face Swap

Video Face Swap

使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热工具

SublimeText3 英文版

SublimeText3 英文版

推荐:为Win版本,支持代码提示!

安全考试浏览器

安全考试浏览器

Safe Exam Browser是一个安全的浏览器环境,用于安全地进行在线考试。该软件将任何计算机变成一个安全的工作站。它控制对任何实用工具的访问,并防止学生使用未经授权的资源。

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

Atom编辑器mac版下载

Atom编辑器mac版下载

最流行的的开源编辑器

VSCode Windows 64位 下载

VSCode Windows 64位 下载

微软推出的免费、功能强大的一款IDE编辑器