Reputation: 1538
It appears that docker-compose replays captured output on container re-launch. This is against expectation, and is misleading about what my container is actually doing. Can this be disabled?
For instance,
restart: always
set.When running docker-compose up
, each time the logging container comes back up after existing, I see all previous output relogged, plus any new additions from the current run.
Here's an easy to run example.
cd <project>/fluentd
, docker-compose build
, & docker-compose up
I'm using docker-compose version 1.16.1, build 6d1ac21 on OSX.
Tips would be great!
Upvotes: 7
Views: 2056
Reputation: 46369
This appears to be an open issue with Docker, where it's replaying logs on up
. A workaround is mentioned here:
alias docker-logs-truncate="docker-machine ssh default -- 'sudo find /var/lib/docker/containers/ -iname \"*json.log\"|xargs -I{} sudo dd if=/dev/null of={}'"
Upvotes: 1
Reputation: 194
Ok. Did you try to remove the restart always for your container?
Upvotes: 0
Reputation: 194
Is this a life cycle problem? There is a difference between a stop and a "rm". If you do a docker-compose stop, the containers are suspended. Use "docker-compose up" to restart them from last time. But "docker-compose rm" will destroy the containers. docker-compose up again to recreate them from scratch.
Upvotes: 0