nixos-vscode-server
nixos-vscode-server copied to clipboard
Support Docker
I'm trying to solve the same problem being solved here, except in a Docker container (for dev container support). I've been trying to get VSCode to work with the official image, however, I've run into the same linking problem. Unfortunately, it looks like the fix here relies on systemd, would there be any interest in supporting a non-systemd approach that can be used in a container?
You could probably pull the shell script from the nixOS wiki and wrap that in whatever init system you're using inside Docker?
I tried looking into this, but it seems quite the different setup, considering the following error:
/root/.vscode-server/bin/e2816fe719a4026ffa1ee0189dc89bdfdbafb164/bin/code-server: line 12: /vscode/vscode-server/bin/linux-x64/e2816fe719a4026ffa1ee0189dc89bdfdbafb164/node: No such file or directory
Of course I could try and patch those paths as well, but that might require a lot of work and testing, and considering the long list of failures that checked for dependencies, this would be just the tip of the iceberg.
Instead I would recommend checking out some existing projects that seem to address your Nix dev container already: https://github.com/xtruder/nix-devcontainer https://github.com/zimbatm/vscode-devcontainer-nix
No worries, I appreciate the response. I had looked into those projects, but the first doesn't support remote container development and the second one had some pretty gnarly requirements. I did end up solving it on my own. I merged the solution into the std framework here. It just uses nix2container and includes this hack which was sufficient to get the node runtime running correctly.