1、Couldn't connect to Docker daemon at http+docker://localhost - is it running?
解决方法: docker没有启动。
输入命令:
systemctl status docker #查看docker运行状态
在使用该命令启动docker时失败,使用 命令journalctl -xe,看到错误有:
SELinux is not supported with the overlay2 graph driver on this kernel. Either boot into a newer kernel or disable selinux in docker (--selinux-enabled=false)
解决方案:Docker之SELinux is not supported with the overlay2 graph driver on this kernel错误-yellowcong
systemctl start docker #启动docker
systemctl enable docker #设置docker开机自启
2、命令docker-compose up报错:
解决办法:
参考:解决 ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?
3、执行docker-compose up报错:
Error Bundler::InstallError, retrying 1/10
An error occurred while installing logstash-core (6.1.1), and Bundler cannot continue.
解决方法:
参考:logstash 插件安装
但是,修改容器里的文件没用,因为每次执行docker-compse up, 都会从镜像中生成新的容器,而不是使用原来的容器。
4、执行docker-compose up报错2:
ERROR: datastore for scope "global" is not initialized
解决方法:
docker swarm init
5、docker pull 报错:net/http: TLS handshake timeout
解决方法:
参考:
1、问题:使用docker时报错“net/http: TLS handshake timeout”的解决方案
2、Docker - 配置DaoCloud的Docker加速器
3、net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting head
可以同时添加多个加速镜像
我的docker镜像 配置文件/etc/docker/daemon.json为:
{"registry-mirrors": ["http://f1361db2.m.daocloud.io", "https://dp65amkq.mirror.aliyuncs.com", "https://docker.mirrors.ustc.edu.cn"]}
主要是阿里的镜像加速器有用
6、错误:docker容器overlay
/dev/mapper/cl-root 50G 50G 20K 100% /
devtmpfs 32G 0 32G 0% /dev
tmpfs 32G 0 32G 0% /dev/shm
tmpfs 32G 196M 32G 1% /run
tmpfs 32G 0 32G 0% /sys/fs/cgroup
/dev/sda2 1014M 230M 785M 23% /boot
/dev/mapper/cl-home 3.6T 64G 3.5T 2% /home
tmpfs 6.3G 12K 6.3G 1% /run/user/42
overlay 50G 50G 20K 100% /var/lib/docker/overlay2/8ecd45c848e59db6e594e571841fe874d536d53d5ef85f9109f4ccb98efc209b/merged
overlay 50G 50G 20K 100% /var/lib/docker/overlay2/6aa2f673c16727b4131ea482f3c403b2e715620fd68ac90b82d8e1f007a63147/merged
overlay 50G -64Z -28K 100% /var/lib/docker/overlay2/2a0c71bcfcb6a7774919bef0c5adac28af5640fbd89457b429782e7203606f9e/merged
overlay 50G 50G 20K 100% /var/lib/docker/overlay2/03f1c4f628fb46aebc5943bf037e7de85cff7189fd73c2fb3540ecbdb3f9c913/merged
overlay 50G 50G 20K 100% /var/lib/docker/overlay2/9333878dc36a3131aa13e5466e8e834bd0a37de50fd9d064c4a846d969251900/merged
overlay 50G 50G 20K 100% /var/lib/docker/overlay2/2f7b56c37bfcee3923fbfc3a8909ab490755d9d21300efe93a0a5227aacb6f43/merged
docker容器overlay。可以看出docker容器的存储与/dev/mapper/cl-root的大小直接相关。所以在安装centos时,要扩大/dev/mapper/cl-root的大小,减小/dev/mapper/cl-home的大小。
解决办法:
解决/dev/mapper/centos-root 占用了过高问题
Linux 根目录爆满 解决(/dev/mapper/centos-root 100%问题)