docker-compose up 清除屏幕

huangapple go评论58阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2023年3月7日 18:27:25
  • 转载请务必保留本文链接:https://go.coder-hub.com/75660759.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定