devcontainer.json
@behrica:
I only think about a small subset, of "fields" from the devcontainer.json file
Firstly there is an existing cli tool, which should be "called" from emacs:
https://code.visualstudio.com/docs/remote/devcontainer-cli
This does a big chunk of the work already.
It does a image build, as vscode would do.
This is the "first stage build".
Then we would only need code, which does something with 5 fields from the "devcontainer.json";
- postCreateCommand
- postStartCommand
- postAttachCommand
- initializeCommand
- onCreateCommand
-> 5 times "docker exec ..."
and the there are some options, which "configure" how the final "docker run" is executed:
- mounts
- ports ...
I have initial code for this, which basically is a sequence of calls (5 or 6) to "docker ....
This would therefore simulate what VSCode does when it "builds and starts" a devcontainer from a devcontainer.json file.
All the VSCode specific fields in there, Emacs would ignore.
I was starting to build this as a standalone CLI tool (which maybe makes more sense)
I am rather convinced, that "any IDE" on mid-term will support the "devcontainer.json" format, due to the popularity and reach of VSCode.
Curious about any comment from your side.
https://www.reddit.com/r/emacs/comments/iqrze0/work_with_vscodes_dev_containers/
I think it's a lot of work and maybe that would be better in lsp-mode as suggested on the reddit post.
For sure I don't have time for it, but if you do a PR maybe.
I have trouble understanding how that fits "docker" tho, that looks more like "vscode-utils".
Indeed, I have doubts as well. So far Emacs has no "vscode-utils" or "devcontainer" mode.
I understand that you see it out-of-scope for docker.el
I think it's a lot of work and maybe that would be better in lsp-mode as suggested on the reddit post.
The "close relationship" to lsp-mode, I don't see. The use-case is to have an Emacs way to come from a "devcontainer.json" file to a running docker container.
And then we would use features of "docker.el" to use the running container (docker-container-shell, open-container-files-via-tramp )
Closing due to inactivity, if you feel you can move this forward reopen.