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
To use docker run in a shell pipeline or under shell redirection, making run accept stdin and output to stdout and stderr appropriately, use this incantation:
docker run -i --log-driver=none -a stdin -a stdout -a stderr ...
e.g. to run the alpine image and execute the UNIX command cat in the contained environment:
echo "This was piped into docker" |
docker run -i --log-driver=none -a stdin -a stdout -a stderr \
alpine cat - |
xargs echo This is coming out of docker:
emits:
This is coming out of docker: This was piped into docker