Centos 7安装docker的日志

本文记录了在CentOS 7上安装Docker的完整过程,包括解决yum锁定问题、安装依赖及开启Docker服务,并设置开机启动。通过yum命令安装了Docker 1.10.3版本,成功启动并验证了Docker服务。
摘要由CSDN通过智能技术生成

[fb@localhost ~]$ su
Password:
[root@localhost fb]# yum install docker
Loaded plugins: fastestmirror, langpacks
Existing lock /var/run/yum.pid: another copy is running as pid 11577.
Another app is currently holding the yum lock; waiting for it to exit…
The other application is: PackageKit
Memory : 131 M RSS (1.0 GB VSZ)
Started: Sat Sep 3 09:57:26 2016 - 12:02 ago
State : Sleeping, pid: 11577
^C
Exiting on user cancel.
[root@localhost fb]# rm -f /var/run/yum.pid 出问题了,百度的解决方案
[root@localhost fb]# yum install docker
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: centos.ustc.edu.cn
* extras: centos.ustc.edu.cn
* updates: centos.ustc.edu.cn
Resolving Dependencies
–> Running transaction check
—> Package docker.x86_64 0:1.10.3-46.el7.centos.10 will be installed
–> Processing Dependency: docker-common = 1.10.3-46.el7.centos.10 for package: docker-1.10.3-46.el7.centos.10.x86_64
–> Processing Dependency: oci-systemd-hook >= 1:0.1.4-4 for package: docker-1.10.3-46.el7.centos.10.x86_64
–> Processing Dependency: oci-register-machine >= 1:0-1.7 for package: docker-1.10.3-46.el7.centos.10.x86_64
–> Processing Dependency: docker-selinux >= 1.10.3-46.el7.centos.10 for package: docker-1.10.3-46.el7.centos.10.x86_64
–> Running transaction check
—> Package docker-common.x86_64 0:1.10.3-46.el7.centos.10 will be installed

CentOS 7 上安装 Docker 时遇到超时的问题,可能是由于网络连接、依赖包未下载完成、系统防火墙设置、Docker 镜像仓库速度较慢等原因导致。以下是解决步骤: 1. **检查网络**:确保您的机器已连接到互联网,并尝试访问其他网站验证网络是否正常。 2. **更新软件源**:运行 `sudo yum update` 或 `sudo dnf update` 来更新yum或dnf包管理器,以获取最新的安装包信息。 3. **清理缓存**:如果之前安装过程中曾中断,可能会有残余文件影响后续安装。清除缓存目录,如 `/var/cache/yum` 和 `/etc/yum.repos.d/_cacheinfo`。 4. **调整yum时间限制**:临时修改yum的配置文件 `/etc/yum.conf`,增加 `timeout=600` 参数,设置较长的超时时间(单位秒),例如:`timeout=600`. 5. **添加国内镜像源**:为了加速下载速度,可以更换为国内的 Docker 镜像源,比如阿里云的仓库地址。编辑 `/etc/docker/daemon.json` 文件,加入 `{ "registry-mirrors": ["https://mirrors.aliyun.com/docker"] }`。 6. **检查防火墙**:确保 docker 相关端口(默认为80和443,或者可以通过 `sudo firewall-cmd --permanent --add-port=2375/tcp` 添加)没有被防火墙阻止。 7. **重启服务**:安装完成后,重启 `sudo service docker restart` 或 `sudo systemctl restart docker`。 如果以上步骤都试过还是不行,可以尝试卸载并重新安装 Docker,或者寻求更详细的错误日志以进一步诊断问题。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值