Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] plugin to work with Docker containers filesystems #1500

Open
unxed opened this issue Feb 12, 2023 · 5 comments
Open

[feature request] plugin to work with Docker containers filesystems #1500

unxed opened this issue Feb 12, 2023 · 5 comments

Comments

@unxed
Copy link
Contributor

unxed commented Feb 12, 2023

Currently Docker suggests using docker cp <src-path> <container>:<dest-path> to copy files to/from container. Not very friendly way if you need to copy large number of files from/to different folders.

It would be nice to have far2l plugin allowing to work with docker containers filesystems just like netrock allows to work with remote filesystems.

@elfmz
Copy link
Owner

elfmz commented Feb 13, 2023

May be even as NetRocks protocol handler that would simplify implementation

@axxie
Copy link

axxie commented Feb 14, 2023

Please note that container FS is available within the host FS tree if you know the PID of the main process of the container.
For example, this is how you can get to it in bash:

❯ docker inspect -f '{{ .State.Pid }}' 11e4ad105ecc
2932
❯ sudo -i
[sudo] password for user: 
❯ cd /proc/2932/root
❯ ll
total 48K
lrwxrwxrwx   1 root root    7 Nov  1 23:15 bin -> usr/bin
drwxr-xr-x   2 root root 4.0K Apr 18  2022 boot
drwxr-xr-x   5 root root  360 Feb 14 11:31 dev
...skipped...
drwxr-xr-x  14 root root 4.0K Nov  1 23:15 usr
drwxr-xr-x  11 root root 4.0K Nov  1 23:18 var

Or you can launch far2l within the correct directory with the following one-liner:

sudo far2l -cd "/proc/$(docker inspect -f '{{ .State.Pid }}' 11e4ad105ecc)/root"

I think it means that you don't need protocol handler, because all FS operations already work.
Far2l just needs some fix for using the same instance for entering this /proc/<pid>/root directory.

@unxed
Copy link
Contributor Author

unxed commented Feb 14, 2023

is available within the host FS tree

Is it read-only access or writing is also enabled?

@axxie
Copy link

axxie commented Feb 15, 2023

Is it read-only access or writing is also enabled?

Yes, both read and write access is supported.

@m32
Copy link
Contributor

m32 commented Apr 29, 2023

try next python plugin :) udocker, some methods are still missing: mkdir, rm, rmdir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants