默认情况下,service docker start或docker -d,docker后台进程默认会在当前终端输出日志,回车几下又可以获得shell,继续执行其他命令,然而当docker有日志需要输出到屏幕时,会再次进入到日志输出,很不方便。有没有办法在启动docker时指定日志输出的地方?
service docker start
docker -d
闭关修行中......
The answer is very straightforward:
docker -d > /path/to/log/file
At the same time you should modify the output of /etc/init.d/docker 的代码,把 start-stop-daemon to also redirect.
/etc/init.d/docker
start-stop-daemon
Docker’s default daemon behavior is indeed quite unpleasant.
The answer is very straightforward:
At the same time you should modify the output of
/etc/init.d/docker
的代码,把start-stop-daemon
to also redirect.Docker’s default daemon behavior is indeed quite unpleasant.