1

I am trying to copy a file from container to local drive, but I encountered several errors during this procedure. Later, I realized that the problem is not related to the commands I use, it is related to permission. Because I cannot list the containers directory that I use when trying to copy.

I try to list the /var/lib/docker/containers using PowerShell on Windows:

PS C:\Windows\system32> docker exec 144625ac6917 ls /var/lib/docker/containers

Gives this error: ls: cannot access '/var/lib/docker/containers': No such file or directory

How can I fix this problem?

  • Can you provide a [mcve] with details of the container and any relevant application code? It'd be unusual for there to be a `/var/lib/docker` directory inside a container, and it's not usually good practice to directly access the contents of `/var/lib/docker` in any case. – David Maze Feb 05 '21 at 10:30
  • Thanks David, unfortunately it would be too difficult for me to create an example with Docker. But I just want to know that, how would you monitor the logs of an application that runs on Docker container? I know `docker logs` but I need a better way to display the logs better view and formatted. Any idea? –  Feb 05 '21 at 11:20
  • @DavidMaze Any help please? –  Feb 05 '21 at 15:08
  • The linked question seems to have a pretty solid answer: either it's in `C:\ProgramData\docker\containers\`, or it's inside a Linux VM at that path, but that path is not a path that's visible from inside the container. – David Maze Feb 05 '21 at 15:54
  • I had already look at `C:\ProgramData\Docker` directory and there is not any container folder :( –  Feb 05 '21 at 17:13
  • And I already followed that steps before asking the question. `find /var/lib/docker/containers/ -type f -name "*.log"` not works –  Feb 05 '21 at 17:17

0 Answers0