-
Notifications
You must be signed in to change notification settings - Fork 69
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
First draft of devcontainers #1520
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Max Allan <max.allan@chainguard.dev>
✅ Deploy Preview for ornate-narwhal-088216 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
I will take this from here, but I want to know what the goal is: is it more to walk someone through a Python example or is it more to show the different ways one can set up a dev container? Going between root and nonroot, having a requirements.txt or not... you can either make those decisions and make it a tutorial, or just explain the different aspects to keep in mind in terms of dev containers.
If you think the audience you are writing for are familiar with dev containers already, then a tutorial may not be necessary, but if this is totally new to them it may be better to walk through an example.
``` sh | ||
git clone https://github.com/chainguard-dev/edu-images-demos.git | ||
cd edu-images-demos/chainguard-go-devcontainer | ||
git init . |
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.
Do you feel very strongly about having the user initialize a repo on their remote GitHub? I think the tutorial runs fine with just the first two Git lines here.
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.
So, I think it's got 2 jobs. The first part is a "Do this and it works" intro to Dev Containers. (Using Go)
The second part is more trying to explain the changes you need to make for using our images in a Dev Container. (Using Python). Root/nonroot is an entire topic in itself!
The different languages are used to avoid the inevitable "Does this work for other languages" question if the whole thing used Go. I did consider doing a 3rd section with another language but it would be mostly repeating the previous stuff with replacing Python with "whatever" and a different command to install dependencies. Maybe a different set of plugins in VSCode. It doesn't really add much. (Maybe replace all "python" with "node" and "pip" with "npm". Otherwise it looks nearly the same)
Pushing the folder back to a new repo means it works with GitHub Codespaces and you get prompted to "Reopen in Devcontainer" when you open the repo in VS Code. With it in a subdirectory, I don't think it ever prompts you. But it did say it's written for VS Code, so could maybe just make sure the commentary warns people that for Codespaces they'd have to move the folder to the root of their repo.
Another ticket (from a free user) asking how to do Dev Containers
|
Type of change
New document
What should this PR do?
Explains how to use a Chainguard image with Dev Containers
Why are we making this change?
Document all the things!
What are the acceptance criteria?
How should this PR be tested?
Needs chainguard-dev/edu-images-demos#14 to be merged first.
(Or take the devcontainer directory from that repo)
Using VS Code, follow the instructions to open a Go and a Python project in a Dev Container.