使用docker-compose部署了一个应用,一直处于restarting的状态,查看日志发现只有一句:Couldn't set terminal to raw
经查该镜像需要启动时需要保持一个终端打开,因此解决方案是在docker-compose.yml文件中添加如下两行:
stdin_open: true
tty: true
其中 stdin_open
相当于 run
命令中的 -d
, 其中 tty
相当于 run
命令中的 -i
参考资料:
docker-compose 部署 ubuntu 镜像 port 端口不生效_stdin_open:true_汀风说后端的博客-CSDN博客