Skip to content

Conversation

@aduh95
Copy link
Contributor

@aduh95 aduh95 commented Dec 8, 2025

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 node built with all shared libs, similar to what builds test-shared GHA 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

@joyeecheung
Copy link
Member

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)

aduh95 and others added 2 commits December 20, 2025 00:26
Copy link
Member

@joyeecheung joyeecheung left a 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

Copy link
Member

@joyeecheung joyeecheung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aduh95
Copy link
Contributor Author

aduh95 commented Jan 14, 2026

New test run: https://github.com/joyeecheung/devcontainer/actions/runs/20969928645

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
Copy link
Member

@joyeecheung joyeecheung Jan 17, 2026

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)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joyeecheung joyeecheung merged commit ca4b8ad into main Jan 17, 2026
@joyeecheung joyeecheung deleted the nix-env branch January 17, 2026 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Re-use the Nix env that's being tested on nodejs/node

3 participants