一、从docker官方yum源进行安装
1、添加docker官方源
cat >/etc/yum.repos.d/docker.repo2、安装和启动
#安装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 ubuntuDao from DaoCloudInitializing, Please wait a minuteUsing default tag: latestPulling repository daocloud.io/daocloud/daocloud-toolsetaa5dc2eecd4a: Download completeStatus: Image is up to date for daocloud.io/daocloud/daocloud-toolset:latestdaocloud.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 ubuntuPulling ubuntu image metadataPulling ubuntu:latest tag metadata0105f98ced6d: Load layer complete66395c31eb82: Load layer complete002fa881df8a: Load layer completea005e6b7dd01: Load layer completeLoading image to docker ...** Pull ubuntu success. **You can find it with 'docker images ubuntu'登录后复制
其他的可以参考本站之前发布的文章
以上就是CentOS和Fedora系统使用Docker的指南的详细内容,更多请关注【创想鸟】其它相关文章!
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至253000106@qq.com举报,一经查实,本站将立刻删除。
发布者:PHP中文网,转转请注明出处:https://www.chuangxiangniao.com/p/2206558.html