-
Notifications
You must be signed in to change notification settings - Fork 171
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
Provide a Docker environment that can host the current nix environment. #2016
Conversation
…ix environment. - Added Dockerfile based on a NixOS host, to provide a nix-shell bash environment. - Launcher script `run-docker-dev.sh` builds Docker image and runs it launching a shell inside the container. - Added `libX11` to the linux only packages as it is necessary for `node-gyp` in the VS Code build.
Link to test editor |
Link to test editor |
Link to test editor |
Link to test editor |
Link to test editor |
Link to test editor |
Link to test editor |
Link to test editor |
Link to test editor |
Link to test editor |
…the old script driven functionality.
Link to test editor |
Problem:
We want to be able run the full editor stack with minimal fussing around whatever the host environment is.
Fix:
This consists of a Dockerfile which constructs an appropriate environment and a launcher script which triggers construction of that Docker image and starts a container for it running our existing nix-shell within that.
It attempts to match up the user IDs between the host and the container so that access to the volume which points at the source code works as it would outside the container. As well as that installing dependencies does so persistently between sessions and does not create those files as the default root user that Docker tends to run as.
Since the nix-daemon does not run in this container, all the
nix-
commands need to run as root.Limitations:
To run the browser tests inside the container on Linux appears to require some extra shenanigans in the host because reasons:
jessfraz/dockerfiles#65 (comment)
Commit Details:
bash environment.
run-docker-dev.sh
builds Docker image and runs itlaunching a shell inside the container.
libX11
to the linux only packages as it is necessary fornode-gyp
in the VS Code build.Making it work with VSCode
Problem
For Mac users, the
./run-docker-dev.sh
shell script is not good enough: because it uses Volumes to synchronise files between the host OS and the docker VM, the performance is incredibly bad.Potential Fix (WIP):
Use VSCode Remote - Containers to clone utopia repo inside the Docker VM on the mac. This avoids setting up file sync between the host OS and docker vm. This is faster. The downside is that this image lives inside the docker VM inside the single opaque docker image. Which means that this is pretty much magic land, and not easy to debug.
Commit Details
.devcontainer/devcontainer.json
which points to the Dockerfile