通過如下的文件啟動容器后
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
且執(zhí)行如下命令報錯:
>>> docker exec -i -t test bash
Error response from daemon: Container 39694c66a560e9b596ecb51bf678bbc0e5172329b2d9541aa57eda453d093623 is restarting, wait until the container is running
改成如下后解決文章來源:http://www.zghlxwxcb.cn/news/detail-509483.html
version: "3.8"
services:
test:
image: python:3.10-slim
container_name: test
tty: true
參考:https://stackoverflow.com/a/63990209文章來源地址http://www.zghlxwxcb.cn/news/detail-509483.html
到了這里,關(guān)于【Docker】解決docker-compose啟動的容器一直處于restarting狀態(tài)的問題的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!