Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

max-allan-cgr
Copy link
Contributor

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?

  • Review for content/tone/etc.
  • Test

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.

Signed-off-by: Max Allan <max.allan@chainguard.dev>
@max-allan-cgr max-allan-cgr added the documentation Improvements or additions to documentation label Apr 16, 2024
@max-allan-cgr max-allan-cgr requested a review from a team as a code owner April 16, 2024 09:47
Copy link

netlify bot commented Apr 16, 2024

Deploy Preview for ornate-narwhal-088216 ready!

Name Link
🔨 Latest commit 5a260ff
🔍 Latest deploy log https://app.netlify.com/sites/ornate-narwhal-088216/deploys/661e494959851a0008e7ff5f
😎 Deploy Preview https://deploy-preview-1520--ornate-narwhal-088216.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Collaborator

@ltagliaferri ltagliaferri left a 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 .
Copy link
Collaborator

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.

Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants