-
-
Notifications
You must be signed in to change notification settings - Fork 10
feat: make use of Nix files to set up dev env #22
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
Conversation
|
Kicked off a build to see if the image built from this branch works https://github.com/joyeecheung/devcontainer/actions/runs/20376852332 (when it's done it'll be published to https://hub.docker.com/r/joyeecheung/node-devcontainer) |
Co-authored-by: Joyee Cheung <[email protected]>
joyeecheung
left a comment
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.
LGTM with a suggestion on docs
Co-authored-by: Joyee Cheung <[email protected]>
joyeecheung
left a comment
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.
Looks like it built successfully, not sure how to test it further though |
| # Setting up direnv for the local clone, see envrc/README.md for more info | ||
| COPY --chown=root:developer --chmod=0755 ./envrc/ /home/developer/envrc/ | ||
| ARG IMAGE_VARIANT=static-libs | ||
| RUN cp "/home/developer/envrc/${IMAGE_VARIANT}.envrc" /home/developer/nodejs/node/.envrc |
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 gave it a try and I think this now needs an update in the devcontainer.json - at least, when paired with the default published image invariant (which uses static-lib). This is because devcontainers work by mounting the working dir, which overrides the .envrc copied within the container.
"postStartCommand": "cp /home/developer/envrc/static-libs.envrc /home/developer/nodejs/node/.envrc && direnv allow /home/developer/nodejs/node"
If we add more published variant in the future, we can just add another devcontainer.json variant in the upstream that copy the corresponding envrc for a different paired image (e.g. "nodejs/devcontainer:shared-nightly" pairs with shared-libs.envrc, and then you can spin a devcontainer with a readily built shared lib configuration to test things)
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.
Opened nodejs/node#61414
I first attempted to create the Docker image using Nix tools, but that ended up being too complicated, in the end it was easier to install Nix from the Dockerfile, and update the existing scripts to use Nix provided tools.
Worth noting the image contains a
nodebuilt with all shared libs, similar to what buildstest-sharedGHA workflow on nodejs/node; we could certainly disable that to use the vendored static deps instead, the tradeoff being the build would take longer.Fixes: #18