I recently had to clean up my full disk because of space taken by past docker containers. So I assume that I can access logs of killed containers.
For example I have the
By default, destroying a container will also remove logs. If you need logs, you have to specify a --log-driver option. On a modern GNU/Linux box, use journald, for example with the docker run command
docker run --log-driver=journald
Another example using docker-compose.yml syntax :
mycontainer:
image: myimage
logging:
driver: journald
options:
tag: mytag
Then access logs using journalctl command + filter rules
journalctl -u docker CONTAINER_NAME=mycontainer_name
journalctl -u docker CONTAINER_TAG=mytag
Tag is useful when you're running a multiple service application, for example with docker-compose.
I think in your case, the container is "recreated" using docker-compose so logs are linked to container lifetime if you don't specify logging-driver stuff.
Also, Docker history command is linked to an image, not a container (container == running instance of a specified image)