英文:
docker-compose up clear screen
问题
有没有办法使docker-compose up
在构建之前和运行之前不清除终端?
我想要在运行服务之前看到之前的输出,但它总是清除屏幕,我找不到任何选项来保留之前的输出。
编辑
这里有一个屏幕清除发生的示例:
https://asciinema.org/a/0VUPSfbaEZqG8Ha1dG7YCmNuA
请注意它清除屏幕2次:首先我运行docker-compose up
,然后它开始启动应用程序(大约在00:08),它清除屏幕并显示“在观察模式下开始编译”(在00:10),最后在00:11再次清除屏幕并显示“检测到文件更改。开始增量编译”。
英文:
Is there a way to make docker-compose up
don't clear terminal after build and before run ?
I want to see the output made before running the services, but it will always clear screen and I can't find any switches to make it maintain the previous output.
EDIT
Here's an example of the screen clearing happening:
https://asciinema.org/a/0VUPSfbaEZqG8Ha1dG7YCmNuA
Please notice it clearing screen 2 times: first I do a docker-compose up, then it begins starting the app (at aprox. 00:08), it clears the screen and says "starting compilation in watch mode" (at 00:10) and finally it clears screen again in 00:11 saying "File change detected. Stating incremental compilation".
答案1
得分: 1
Launching docker-compose up
不会清空终端。参考这里。
在这种特定情况下,问题出现在启动的容器内,其中运行了 nest start --watch
命令。要防止应用程序清屏,请使用 --preserveWatchOutput
参数运行。
英文:
Launching
docker-compose up
does not make the terminal clear. Reference here.
In this specific case, the problem resides inside the launched container, where the nest start --watch
command is run. To prevent the app clearing the screen, run with --preserveWatchOutput
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论