Cleanup and annotate devcontainer.json#58
Conversation
samruddhikhandale
left a comment
There was a problem hiding this comment.
Left few minor comment, besides that looks good to me! ⚡
|
|
||
| // Upon Codespaces or image prebuild, refresh the npm and node.hs installation (async from environment creation) | ||
| "updateContentCommand": "npm install", | ||
| "postCreateCommand": "", |
There was a problem hiding this comment.
I wonder if this was explicitly added to avoid the oryx tool from running? 🤔
There was a problem hiding this comment.
That is a dirty hack! No other way to do that?
| "hostRequirements": { | ||
| "cpus": 4 | ||
| }, | ||
| "waitFor": "onCreateCommand", |
There was a problem hiding this comment.
My understanding is that using this instead of the default updateContentCommand means we can connect sooner, while we're installing dependencies, as opposed to waiting for dependencies to be installed.
That's mostly a moot point, given that we're using prebuilds but still seems valuable?
There was a problem hiding this comment.
I don't see how it is valuable if we're using Codespaces prebuilds. Help me understand
There was a problem hiding this comment.
Two thoughts:
- If prebuilds are broken or stale, it helps
- If folks are copying & pasting the devcontainer from these templates to use in their own projects, this is a reasonable default
There was a problem hiding this comment.
Makes sense. What would you provide as a comment inline to explain the wait for an empty command?
There was a problem hiding this comment.
How about: "Allow connecting earlier, while we're still installing dependencies"
Co-authored-by: Samruddhi Khandale <samruddhikhandale@github.com>
Co-authored-by: Samruddhi Khandale <samruddhikhandale@github.com>
| @@ -1,21 +1,34 @@ | |||
| { | |||
| @@ -1,21 +1,34 @@ | |||
| { | |||
There was a problem hiding this comment.
// See the devcontainer spec at https://containers.dev/implementors/spec/
"name": "React Codespaces Template",
// Container image to build environment from
// universal contains many tools making it useful in many contexts https://github.com/devcontainers/images/tree/main/src/universal
"image": "mcr.microsoft.com/devcontainers/universal:2",
// Specify the minimum machine spec for running the dev container
"hostRequirements": {
"cpus": 4
},
|
ok |
Removed empty commands, and the nonsensical
waitFor.Annotated for readability