Docker: ls without ls
Quick tip: if you want to inspect the filesystem of a running Docker
container, but it doesn’t even include a shell, let alone ls
, you
can do the following:
docker export some-container | tar -tf -
You can also print out the contents of a single file with tar
(omit
the leading slash):
docker export some-container | tar -xOf - etc/some/file.txt