Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

How to redirect docker-compose command stdout stderr from docker container to file

#!/bin/sh

# redirect stdout and stderr to files
exec >/tmp/stdout.log
exec 2>/tmp/stderr.log

# now run the requested CMD without forking a subprocess
exec "$@"
Source by forums.docker.com #
 
PREVIOUS NEXT
Tagged: #How #redirect #command #stdout #stderr #docker #container #file
ADD COMMENT
Topic
Name
4+2 =