使用docker run命令运行容器,再进入容器时报错
运行容器命令
docker run --restart=always --name mongo -v /data/mongo:/data/db -p 27017:27017 -d mongo --auth
进入容器命令
docker exec -it mongo bash
错误信息
Error response from daemon: Container 90831dd80b32a1502d9535c874ceec899b5fd70c883481195b4f36cd29be47b0 is restarting, wait until the container is running
[root@Tracy ~]# docker exec -it mongo bash
Error response from daemon: Container 90831dd80b32a1502d9535c874ceec899b5fd70c883481195b4f36cd29be47b0 is restarting, wait until the container is running
分析
(1)查看容器是否启动
[root@Tracy ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
90831dd80b32 mongo "docker-entrypoint.s…" About a minute ago Restarting (14) 20 seconds ago mongo
启动中,但是没有端囗
(2)查看端囗是否被占用
[root@Tracy ~]# lsof -i:27017
端囗没有被占用
(3)查看docker日志
docker logs --tail 50 --follow --timestamps mongo # mongo为容器名称
其中有个错误信息提示:磁盘没有空间了
(4)查看磁盘空间
du -ach / --max-depth=1文章来源:https://www.toymoban.com/news/detail-515336.html
[root@Tracy ~]# du -ach / --max-depth=1
0 /sbin
0 /lib
8.7G /var
0 /sys
4.0K /media
4.0K /srv
0 /.autorelabel
176M /boot
du: cannot access ‘/proc/23839/task/23839/fd/4’: No such file or directory
du: cannot access ‘/proc/23839/task/23839/fdinfo/4’: No such file or directory
du: cannot access ‘/proc/23839/fd/3’: No such file or directory
du: cannot access ‘/proc/23839/fdinfo/3’: No such file or directory
0 /proc
7.0G /usr
4.0K /mnt
16K /lost+found
16K /opt
59M /tmp
0 /dev
0 /lib64
39M /etc
179M /run
109M /data
3.4G /home
264M /root
0 /bin
20G /
20G total
磁盘空间一共20G,都被占满了,清除或扩容磁盘空间即可。文章来源地址https://www.toymoban.com/news/detail-515336.html
到了这里,关于docker进入容器时报错 Error response from daemon: Container xxx is restarting, wait until the container is的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!