I need access to data (logs and cached files) from my docker containers, and so I am following instructions in this article on bindmounting volumes.
I have created the ~/appdata/example-app/logs
directory on the server and started a container with the following command.
$ docker run -d -v ~/appdata/example-app/logs:/logs --restart always -p 81:80 path-to-docker-image-repo
But no logs are being output to the server directory.
I run the following command to inspect the files within the container:
$ docker exec -t -i example-app /bin/bash
I can see that my log file does indeed exist in the container (and have also verified that the app is running as expected). Note that this app is an ASP.NET Core app. I'm not sure if that is relevant, possibly because the path structure may be different for ASP.NET core apps?
logs\2019-06-14.log.json
I don't understand why I'm not seeing the files in the ~/appdata/example-app/logs
directory.
Also, I actually want two directories mounted to the server, an additional directroy for cached images as well as logs, if this is possible?