Devcontainer improvements#10
Conversation
zimbatm
left a comment
There was a problem hiding this comment.
Awesome. Thanks for taking what I started and running with it!
|
|
||
| # allow ubuntu ELF binaries to run. VSCode copies it's own. | ||
| mkdir -p lib64 | ||
| ln -s ${glibc}/lib64/ld-linux-x86-64.so.2 lib64/ld-linux-x86-64.so.2 |
There was a problem hiding this comment.
are you sure you don't want to keep this? Other extensions might also download random binaries.
There was a problem hiding this comment.
I would add later if there would be some issues, would not make this default as it solves only part of problem. If some third party binary is not statically linked, it's a good chance it will require also some other libraries. Regarding installing of vscode plugins can probably be automatized using home-manager module and binaries can be patched there.
There was a problem hiding this comment.
please don't remove this otherwise it will break actions/checkout@v3 when we use devcontainer as github action iamge
|
|
||
| config = { | ||
| Cmd = [ "/nix/var/nix/profiles/default/bin/bash" ]; | ||
| Entrypoint = [ "/nix/var/nix/profiles/default/bin/entrypoint.sh" ]; |
There was a problem hiding this comment.
When I was hacking on it, vscode was running the container with its own entry point. Is that not the case anymore?
There was a problem hiding this comment.
Microsoft does seem to do the same in some of their devcontainers: https://github.com/microsoft/vscode-dev-containers/blob/560deca1511296d64d31acea1ba08feea3f7850b/containers/docker-from-docker/.devcontainer/Dockerfile#L26
There was a problem hiding this comment.
I mean it works for me if using docker-compose, but have to still test with plain devcontainer.
3f2de75 to
6264454
Compare
|
@offlinehacker sorry this went out of my radar. Would you like me to merge this PR? |
|
I can't say, I don't use it currently, but maybe others find it useful. I don't like some parts of how nix is building docker images, as it's too magic. I switched to debian based image and wrote: https://github.com/xtruder/debian-nix-devcontainer, which I am successfully using for of all of my projects. |
|
Yeah, that makes sense. I also think that it will be less pain as tooling in vscode tends to assume a debian-like environment. |
This pull request implements several improvements for devcontainers:
LD_LIBRARY_PATH, but by usingentrypointthat does patchelf on vscode node binary. See also comment in code.I also implemented example repo that is using this image for devcontainer: https://github.com/xtruder/nix-devcontainer