I would like to view the output history of a Docker container. I am running the container like so:
docker run -itd --name mytest ubuntu:latest /bin/bash
I can then run the following commands:
docker exec -it mytest /bin/bash root@f1b3fc8464d2:/# echo "it works" it works root@f1b3fc8464d2:/# exit
I then want to run some command to show me "it works", as well as the history of any other output, as I would have seen had I just initially stayed attached to the container the whole time. Changing the initially run command, or other kinds of enabling logging are acceptable.
Based on another stackexchange question, I've already tried this:
docker logs -f mytest
But it has no effect. It doesn't show output history, and it doesn't show output that happens while the command is running. It doesn't show anything.