-
Notifications
You must be signed in to change notification settings - Fork 527
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
Proposal: show files of running containers #2333
Comments
I think that this functionality overlaps too much with Remote - Containers, TBH. Remote - Containers offers the ability to attach to both containers and volumes and actually do things with the filesystem, not just see it. |
While I agree that you can use Remote - Containers for similar purposes, it's much more invasive when connecting (e.g. installing the VS Code server, container-side extensions, etc.) as it tries to make that container a "dev" container. If you just want to poke around the file system and look at a couple of files, it seems very heavy handed. |
I agree with @philliphoff Being able to see where the files are and what they contain is what most users need. Injecting VS Code backend into the container for that purpose is more than necessary, and also not intuitive/discoverable. |
That's fair although I wouldn't say I'm quite convinced. If we do add this, we should use the API instead of the CLI. The slow performance of the CLI would make this feature pretty frustrating. |
This is a great idea with one big BUT: existing Docker volume drivers don't support data access concurrency. See discussion: Concurrency managed by volumes. The pre-requisite is PR: develop Docker volume driver supporting data access concurrency without involving Inter-container IPC based synchronization. Maybe, it is possible when the container is stopped when somebody looks into its volumes and all mounts are read-only except one. |
This post contains explanations for sharing data between containers in the Docker sharing data between containers: how and why. Regarding the architecture proposal, you can ask Erich Gamma. |
Why it is so hard to implement? |
Note: in addition to what @bwateratmsft said about performance, what Visual Studio currently does (execute 'ls' command inside the container and parse output) will not work for containers built from scratch (because they don't have any shell binaries). See this discussion on StackOverflow for some ideas. |
@karolz-ms That's a known limitation and I've seen such containers here and there when using CTW, but I'm not sure there's a "no touch" option. We could copy in a shell, execute it, and then remove the shell; but there will be the potential for leaving bits behind. That might be ok for such containers, but I think we'd want to warn users that we're making modifications to the running container in such cases. |
@philliphoff if only volumes could be mounted dynamically... |
The API has a way to get file contents (and presumably write them but haven't validated that): https://docs.docker.com/engine/api/v1.40/#operation/ContainerArchive It almost worked for listing directory contents but the output of {
"name": "/",
"size": 4096,
"mode": 2147484141,
"mtime": "2020-09-29T15:27:33.82Z",
"linkTarget": ""
} Nevertheless, the |
I assume that that API is the basis of the |
I don't know for sure about UPDATE: Yes, it's also the basis for |
I agree that a |
This feature has now been released in 1.8.0. |
Hey 👋 |
@bwateratmsft Clarification: The files of containers and how fast the list of container files are questions without a single answer because according to OCI container format (Docker, runc , Podman, Kubernetes, Openshift,...) every container has more than 1 filesystem: 1. RootFS served by overlay2 driver and created in the memory when the image is loaded, container created, and shared among all running containers by image layers basis. It designed to be very slim and static to ensure big Cloud clusters be scalable. More than one team is working to improve these figures but nobody cares about Root FS too much and overlay2 is maximum has been achieved. 2. Mounted and bound and volumes served by storage drivers of Docker, Podman, and underlying Cloud infrastructure. Scores of developers are employed to improve storage driver and storage services performance to make big data applications and video streaming possible and expected performance is much above 1 terabyte per second for certain drivers and infrastructure. |
@benpinchas why would you like to disable the feature? It does not incur any cost if you do not expand the Files node... |
@karolz-ms First I find this toggle mechanism annoying and much dirtier. (attaching before and after) Second, let's say you have many microservices, and you want to deal with one of them. Before that feature, you would just click on one of them to gain focus, start typing part of the microservice name and vs-code would mark any matched microservices (elements) for you. Now, with this feature, click on one of the elements to gain focus would toggle it and result in an unwanted reveal of its files :( Edit: Still one of the most helpful and powerful extension! |
@benpinchas glad you found a workaround Just FYI the extension now groups container nodes by Compose "project" by default (that is why there is a "docker" top-level node in the new tree layout), but that can be turned off via settings if you don't like that |
Proposal
The Containers tool window (CTW) in Visual Studio allows users to browse the file system of running containers, and users seem to really like this feature. Should we do the same for Visual Studio Code, something along the lines of the mockup below?
As a related item, it was suggested that, when opening a container file, if that container file actually maps to a local file that's been volume-mounted into the container, that the local file be opened instead. (This is something that CTW does not currently do, but the idea seems good in both places.)
The text was updated successfully, but these errors were encountered: