I want to create a docker that reads the logs, stdout and stderr from another container 'factorio' on a continuous basis.
I know I should do this as a volume but my best current option is
sudo docker logs -f factorio &> /var/log/factorio/current.logs
I run the above on a screen. I had it as a background command but when you exit the terminal it would exit that command. The screen allows it to run on its own terminal.
which runs in the background and constantly updates the file. My new app container connect as a volume to this file location and tails every 5 seconds to get any updates and send notifications based on those updates. There is definitely a better way to do this with volumes but I don't know-how.
some app docker command below:
sudo docker run -d \
-p 34197:34197/udp \
-p 27015:27015/tcp \
-v /opt/factorio:/factorio \
--name factorio \
--restart=always \
dtandersen/factorio:0.17.16
The log file is /opt/factorio/factorio-current.log but does not include stdout or stderr. docker logs contains this information.
docker container reading another container logs
Re: docker container reading another container logs
[Koub] Moved to Technical Help
Koub - Please consider English is not my native language.