docker-compose, new container version and logs persistence -
quite common use-case docker-compose:
- a application's code pulled repository using git.
- a docker-compose.yml looking this:
version: '2' services: web: build: ./myapp
when want deploy new version pull latest version of code make docker-compose --build -d
.
works except each time make update erases past logs accessible using docker-compose logs
. understand why docker behaves way (even if docker-compose recreates container same name it's still brand new container, it's quite logical logs flushed). still, it's not practical.
any 1 has solution ? preferably 1 does not involve modifying images or using volumes store logs. (because should whole point of docker logs, not having worry that).
you redirect output log file when starting containers, like:
docker-compose --build --no-color --force-recreate &> logs &
instead of docker-compose logs
tail logs
anytime want.
Comments
Post a Comment