service docker startOr
docker -d, the docker background process will output logs at the current terminal by default, and the shell can be obtained after entering a few times to continue executing other commands. However, when the docker has logs to output to the screen, it will enter the log output again, which is inconvenient. Is there any way to specify where the log is output when the docker is started?
The answer is straightforward:
docker -d > /path/to/log/file
At the same time, you should revise it.
/etc/init.d/dockerThe code of, put
start-stop-daemonThe output of is also redirected.
Docker’s default daemon behavior is really annoying.