Redirecting command output in docker

后端 未结 4 652
广开言路
广开言路 2020-12-01 04:26

I want to do some simple logging for my server which is a small Flask app running in a Docker container.

Here is the Dockerfile

# Dockerfile
FROM dre         


        
4条回答
  •  粉色の甜心
    2020-12-01 04:37

    Just a complement, when using docker-compose, you could also try:

    command: bash -c "script_or_command > /path/to/log/command.log 2>&1"

提交回复
热议问题