devcontainer
)To run locally on your machine, you'll want to install Docker Desktop and start it up.
Once you've got Docker Destop running, you can run the following command to pull and start the image:
docker pull nodejs/devcontainer:nightly
docker run -it nodejs/devcontainer:nightly /bin/bash
Once you've run those commands, you'll be in a shell inside the running container. If you need to escape, type exit
. You should be good to jump to Working in the Container.
/home/developer/nodejs/node
.
/home/developer/nodejs/node/configure --ninja && make -C /home/developer/nodejs/node
devcontainers
to this Assuming you've already got the Docker container running:
origin
to your own fork rather than nodejs/node
USERNAME
is your GitHub username: $ git remote set-url origin https://github.com/USERNAME/node.git
git remote -v
git config --global user.name "YOUR NAME"
git config --global user.email "YOUR@EMAIL.TLD"
gh
CLI and run gh auth login
to login and add a new key.Some useful commands:
docker build .
- build the current Dockerfiledocker image ls
- list the images and IDsdocker run -it <image id> /bin/bash
- run a container and shell into itdocker tag <image id> devcontainer:nightly
- run to tag an image as nightly
Some notes on what's been helpful:
RUN
statement in the Dockerfile into multiple RUN
statements, each containing a single command. This provies more precise information about what exactly is failing if the Docker build fails and isn't providing helpful output.RUN
statement in the Dockerfile and running docker build
, running the built container, and individually running each command in the running container is a better development experience than working outside of the built container.