Skip to content

Adds support for editing files within running containers#2671

Merged
philliphoff merged 6 commits intomainfrom
philliphoff-edit-files
Jan 26, 2021
Merged

Adds support for editing files within running containers#2671
philliphoff merged 6 commits intomainfrom
philliphoff-edit-files

Conversation

@philliphoff
Copy link
Member

@philliphoff philliphoff commented Jan 25, 2021

Implements the writeFile() method of our container FileSystemProvider which allows VS to write changes made to in the editor back to the container.

As Docker does not support the get/put archive API when using Hyper-V -based container (i.e. Windows container), this functionality is enabled only for Linux-based containers for the time being. While we have workarounds to get files off of Windows containers, I've yet to make the inverse work which means more investigation. As Windows container usage is small, I think it's better to get the feature out rather than first insist on strict parity.

Related to #2465.

@bwateratmsft
Copy link
Collaborator

Related to #2465.

It looks like this just fixes #2465 entirely, right?

@philliphoff
Copy link
Member Author

It looks like this just fixes #2465 entirely, right?

Since it doesn't allow editing of Windows containers, I wouldn't say the issue is completely resolved, though we could close this issue and open a investigatory issue for extending support to Windows containers (if and when I can actually get that to work).

@bwateratmsft
Copy link
Collaborator

It looks like this just fixes #2465 entirely, right?

Since it doesn't allow editing of Windows containers, I wouldn't say the issue is completely resolved, though we could close this issue and open a investigatory issue for extending support to Windows containers (if and when I can actually get that to work).

Personally I would not shed any tears for ignoring Windows container support for file editing (or files at all for that matter, but you at least got read working).

I guess I'd vote for opening a separate issue and dumping it in the Future milestone until users express interest.

@philliphoff
Copy link
Member Author

Sounds good to me; opened #2675.

@philliphoff philliphoff merged commit 7e14f74 into main Jan 26, 2021
@philliphoff philliphoff deleted the philliphoff-edit-files branch January 26, 2021 17:52
@bwateratmsft bwateratmsft linked an issue Jan 26, 2021 that may be closed by this pull request
Dmarch28 pushed a commit to Dmarch28/vscode-docker that referenced this pull request Mar 4, 2021
)

* Sketch infrastructure for writing files.

* Implement putContainerFile() with tar-stream.

* Replace tar with tar-stream for reading archive.

* Better handle errors during extraction.

* Add telemetry for writing files.
@microsoft microsoft locked and limited conversation to collaborators Oct 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable editing of files in a running container

2 participants