在CentOS、Fedora系统中使用Docker的方法
https://www.518cn.com 发布时间:2025-03-18 09:07 作者:网络
摘要:这篇文章主要介绍了在CentOS、Fedora系统中使用Docker的方法,需要的朋友可以参考下
一、从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
看起来像这样:
~ 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'
其他的可以参考运维之家之前发布的文章
相关文章
Centos7.8怎么更新openssh? Centos升级openssh的技巧
Centos7.8怎么更新openssh?Centos7.8系统想要安装openssh,该怎么安装呢?下面我们就来看看Centos升级...03-18Centos7.8怎么更新openssl? CentOS升级OpenSSL的技巧
Centos7.8怎么更新openssl?Centos7.8系统想要升级OpenSSL,该怎么升级呢?详细请看下文介绍...03-18- centos7没有图形化操作可能对很多人来说都不太习惯,下面我们来为centos7安装图形化界面,本文...03-18
- 今天小编在安装RHEL7的时候,一步留神没有安装图形化桌面,下面分享一下安装图形化桌面的过...03-18
- 下载CentOS-7.0-1406的时候,有很多可选则的版本,对于普通用户来说,不知道选择哪个好,下面...03-18
Centos 7怎么手动配置ip地址? Centos7配置IP地址的技
Centos 7怎么手动配置ip地址?Centos 7系统想要自己配置ip地址,该怎么操作呢?下面我们就来看看...03-18- 这篇文章主要介绍了Centos 7 压缩与解压缩命令小结,需要的朋友可以参考下...03-18
- 这篇文章主要介绍了Centos7 yum安装git服务器,需要的朋友可以参考下...03-18
CentOS 6.6系统怎么安装?CentOS Linux系统安装配置图
CentOS系统怎么安装?今天小编就为大家带来了CentOS Linux系统安装配置图解教程,需要的朋友可...03-18在vmware虚拟机中安装Linux系统CentOS7详细教程
这篇文章主要为大家分享在虚拟机中安装Linux系统CentOS7的方法,非常详细,看了这篇基本上都...03-18
最新评论