Container tips and tricks

From HPCWIKI
Revision as of 12:20, 15 November 2023 by Admin (talk | contribs) (Created page with " == Find container root folder in host == <syntaxhighlight lang="bash"> # Get container root directory path $ container_root=$(sudo docker inspect --format '{{.GraphDriver.Data.MergedDir}}' <container_id>) # Then we can access by creating a symlink to any subdirectory or file within the container $ sudo ln -s "$container_root/</path/to/mount>" <symlink_name> </syntaxhighlight> == References == <references />")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Find container root folder in host

# Get container root directory path
$ container_root=$(sudo docker inspect --format '{{.GraphDriver.Data.MergedDir}}' <container_id>)

# Then we can access by creating a symlink to any subdirectory or file within the container
$ sudo ln -s "$container_root/</path/to/mount>" <symlink_name>

References