I'm running Docker Desktop on Windows with WSL2, and I'm trying to locate my Docker containers. On my Ubuntu server, they appear in /var/lib/docker/containers, but on my local setup, that folder is empty. I ran the command `docker info --format '{{ .DockerRootDir }}'`, and it returns /var/lib/docker, which also has a containers folder, yet it's empty. Can anyone help me figure out what's going on?
1 Answer
Docker Desktop operates within its own isolated WSL2 instance, called docker-desktop. This means that the filesystem there is separate from your primary WSL2 instance, which might explain why you can't see the containers. Also, might I ask what you're attempting to do? It feels a bit like an XY problem to access the raw filesystem directly.
I'm trying to run Filebeat to read all my container logs and send them to Elasticsearch. Filebeat needs to access the log files directly, and according to the documentation, they should be found at '/var/lib/docker/containers/*/*.log'. They are present on my Linux production server, but the containers folder is empty in my WSL environment. Is there a way to redirect the logs to another location?