您现在的位置是:网站首页> 编程资料编程资料
在CentOS、Fedora系统中使用Docker的方法_RedHat/Centos_操作系统_
2024-02-22
351人已围观
简介 在CentOS、Fedora系统中使用Docker的方法_RedHat/Centos_操作系统_
一、从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'
其他的可以参考之前发布的文章
相关内容
- CentOS的网络带宽出口大小的查看方法_RedHat/Centos_操作系统_
- Centos安装nmon讲解_RedHat/Centos_操作系统_
- CentOS下命令汇总之正则表达式详解_RedHat/Centos_操作系统_
- 少女前线PSG1怎么样 PSG1值得练吗_手机游戏_游戏攻略_
- 保卫萝卜3公园第19关金萝卜怎么打 公园十九关图文攻略_手机游戏_游戏攻略_
- 少女前线OTS14怎么样 OTS14值得练吗_手机游戏_游戏攻略_
- 奇迹暖暖绛染灵溪套装怎么样 绛染灵溪获得攻略_手机游戏_游戏攻略_
- 奇迹暖暖柴豆与呱啦套装怎么样 柴豆与呱啦套装获取攻略_手机游戏_游戏攻略_
- 奇迹暖暖水潋柔情套装属性怎么样 水潋柔情套获取方法_手机游戏_游戏攻略_
- 保卫萝卜3公园第4关怎么过 公园第4关金萝卜图文攻略_手机游戏_游戏攻略_
