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
Add VSCode devcontainer configuration #209
Add VSCode devcontainer configuration #209
Conversation
Some potential to combine this with #192, and include the Docker ext as a recommended extension, though also raises the question of it the instructions provided there work for a Docker based workflow (making the compilation database, using it etc). |
I suspect that the compilation database part is still correct, but you'd need to change the compiler path to match wherever it ends up being in the container. Maybe we just add Docker to the list of OSes in all the docs pages? |
Yeah, if we can make this seemless, I definitely think it should be an "OS tab/option" in the dev setup docs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One tweak, and a question around SELinux settings.
So, the tweak above worked. Onto new issues! Git pull/push with SSH remotes doesn't work inside the container because the docker image lacks SSH. Fixable with The more annoying (but less critical) thing I've run into is that GPG commit signing doesn't work. Like SSH, GPG is not installed in the image (easily fixable like above). Once it's there, it still doesn't work — the Supposedly, this should work as of v118 of the remote-containers extension, but there's no documentation. However, another issue identifies a control to test against. When I try to gpg from inside the "try a sample" node container, I can see my keyring and a socket, and signing works fine: My current hunch is that maybe the image needs to contain GPG already when it boots or the VSCode remote-containers extension doesn't try to set up forwarding. |
To be clear:
|
OK, it works! I brought back the dockerfile and used it to install SSH/GPG into the image. Now when VSCode comes up, everything works out of the box for me (MacOS). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment on the dockerfile, but certainly minor. I would love to get this in, so we can build on it, even if we aren't 100% happy with the documentation piece.
Thoughts @idan ?
@petejohanson yes! I'll hack on the docs tonight and try to get it into a happy place, or move them to a separate branch so we can commit the docker bits and do the docs in a follow-onw |
Per the docs, we can directly specify an image in devcontainer.json: https://code.visualstudio.com/docs/remote/devcontainerjson-reference
Brings back the dockerfile so we can install SSH and GPG into it. This fixes git actions with SSH remotes, and GPG signing now works out of the box. This commit was made from inside the container!
Co-authored-by: Pete Johanson <peter@peterjohanson.com>
This permits users to check ZMK out into arbitrarily-named directories
2bd599d
to
5401afc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fabulous! Thanks sticking with this, and the docs updates.
Add VSCode devcontainer configuration
Add VSCode devcontainer configuration
This creates the a basic harness that permits users to develop with their local checkout inside the same docker container which powers the GitHub action. Does not yet contain docs and tests, but I did try it out with a clean checkout and was able to build images.🎉
See #208 for discussion about where this can go.
Steps to use:
code --install-extension ms-vscode-remote.remote-containers
zmk
folder in VS Code now displays a prompt to re-open inside a container:Reopen in Container
and the VS Code window will reload and do the necessary initial docker setup. This can take a little while.That's it!