通过如下的文件启动容器后
version: "3.8" services: test: image: python:3.10-slim container_name: test restart: always
status一直处于restarting
>>> docker ps container id image command created status ports names 39694c66a560 python:3.10-slim "python3" 4 seconds ago restarting (0) less than a second ago test
且执行如下命令报错:
>>> docker exec -i -t test bash error response from daemon: container 39694c66a560e9b596ecb51bf678bbc0e5172329b2d9541aa57eda453d093623 is restarting, wait until the container is running
改成如下后解决
version: "3.8" services: test: image: python:3.10-slim container_name: test tty: true
参考:https://stackoverflow.com/a/63990209
到此这篇关于docker-compose启动的容器一直处于restarting状态的问题解决的文章就介绍到这了,更多相关docker-compose启动restarting状态内容请搜索代码网以前的文章或继续浏览下面的相关文章希望大家以后多多支持代码网!
发表评论