Add support for Devcontainers in sandbox mode#342
Conversation
|
🚧 Test build enqueued. |
|
🚧 Started test build. |
|
✅ Test build succeeded. To test this build, install it from the testing repository: Built for aarch64 and x86_64 architectures. |
|
Thank you very much @blue42u! I gave your version a try: |
|
doesn't docker collect user data? If I remember correctly podman doesn't collect user data (podman desktop does though it can be turned off) but I'm pretty sure there are a bunch of closed source bits which collect user data in docker cli. Personally I wouldn't be a fan of adding a bunch of data collection into the flatpak. |
|
@acch Just to check, do you have FWIW this PR doesn't solve the underlying @Pioneer-1-1 AFAICT according to a quick web search: the Docker CLI is open-source (Apache license). Any telemetry is fully opt-in, and you get full customization on the endpoint (https://docs.docker.com/engine/cli/otel/). This PR also builds it from source so there's full source provenance available. Some of Docker's other, proprietary products including Docker Desktop do collect data. You don't need any of them to use Zed's Devcontainer support + this PR. |
|
This version works for me on Aurora 43 (not hugely surprising as it is in the uBlue family). |
I checked again and while I can't find anything explicitly stating it it appears you are right and that docker's telemetry is only in the docker desktop application. In that case no objection from me and thanks for the fix. |
|
Works for me on PopOS 24.04LTS |
|
Confirmed working on Fedora Silverblue 43.20260407.0 without escaping sandbox. |
|
One option would be to add compatibility via an extension; this would allow users who need it to install it without increasing the file size for those who don't, something like: Or better yet, join forces and create a plugin that works with multiple code editors, if possible. |
I can see the rational, but considering how popular devcontainers are now and that their features are baked in to zed it would seem pretty strange to ship a zed flatpak which can't run them |
|
🚧 Test build enqueued. |
|
🚧 Started test build. |
|
✅ Test build succeeded. To test this build, install it from the testing repository: Built for aarch64 and x86_64 architectures. |
I tried the previous build (the first one in this PR which I believe was based on zed v0.230) and that worked fine. However, when I attempted to build a devcontainer with this build it failed. I suspect the reason for this is that between The error I received was: |
|
@Pioneer-1-1 I think you're hitting upstream issue zed-industries/zed#52924. I'm running into a similar issue but elsewhere in the deserialization: Both seem to be issues with the native devcontainers implementation itself, not the Flatpak sandbox... |
It's possible it's an upstream error but I don't think it's the one you mentioned. I'm attempting to create a new dev container not launch an existing one. The Have you tried to run a devcontainer with this latest version on your own system? |
|
I had a bit more of a check through the issue you linked (zed-industries/zed#52924) and I'm not almost certain this is unrelated. The errorlog for that issue includes the line: Whereas my issue appears to be due to: So SSH is succeeding in watching in that issue whereas it fails in mine |
|
All, I've copied these changes over to a PR for |
I replied to your comment over on the preview but TLDR I ran your PR for the preview version and encountered exactly the same issue. |
f453de2 to
5615b63
Compare
|
🚧 Test build enqueued. |
|
🚧 Started test build. |
|
✅ Test build succeeded. To test this build, install it from the testing repository: Built for aarch64 and x86_64 architectures. |
|
@blue42u you're latest fix works a treat, I can now both create new dev containers and run existing ones thanks. |
|
Thanks for working on this, I too use devcontainers heavily. However, I usually use the secrets service integration for registry credentials, and it needs a helper binary (from https://github.com/docker/docker-credential-helpers) that is of course not found in the sandboxed environment. |
06f8647 to
4a78eee
Compare
|
🚧 Test build enqueued. |
|
🚧 Started test build. |
|
✅ Test build succeeded. To test this build, install it from the testing repository: Built for aarch64 and x86_64 architectures. |
|
@blue42u your latest version ships with the sandbox escape on. That results in the dev container build failing. You need to disable the flatpak sandbox escape. |
This is intentional, to match the current state of the sandbox default in |
Well the whole argument for turning the sandbox off was ease of use. Therefore, it make little sense to turn the sandbox off in the name of ease of use but then require users to go and check the docs to know to turn the sandbox back on to use dev containers. It achieves the security of sandbox off with the usability of sandbox on; the worst of both worlds. |
4a78eee to
571e3e8
Compare
|
🚧 Test build enqueued. |
|
🚧 Started test build. |
|
✅ Test build succeeded. To test this build, install it from the testing repository: Built for aarch64 and x86_64 architectures. |
571e3e8 to
a93c310
Compare
|
🚧 Test build enqueued. |
|
🚧 Started test build. |
|
✅ Test build succeeded. To test this build, install it from the testing repository: Built for aarch64 and x86_64 architectures. |
|
@flathubbot Can another build be triggered so I can test this? |
|
🚧 Test build enqueued. |
|
🚧 Started test build. |
|
✅ Test build succeeded. To test this build, install it from the testing repository: Built for aarch64 and x86_64 architectures. |
|
After a quick glance it works for me with Without sandboxing it doesn't work. It is still able to pull the containers but can't seem to run them. Here's the errors on a fresh install of Fedora Kinoite: 2026-05-30T14:19:52-07:00 INFO [dev_container::devcontainer_api] find_configs_in_snapshot: Found 1 configurations
2026-05-30T14:19:52-07:00 INFO [recent_projects::remote_servers] SSH: Watching User Config at: "~/.ssh/config"
2026-05-30T14:19:52-07:00 INFO [recent_projects::remote_servers] SSH: Watching Global Config at: "/etc/ssh/ssh_config"
2026-05-30T14:19:52-07:00 WARN [dev_container::devcontainer_manifest] No initialize command found
2026-05-30T14:20:41-07:00 ERROR [dev_container::docker] Non-success result from docker pull: podman: ~/.local/share/flatpak/app/dev.zed.Zed/x86_64/test/aaad149d20296c70002848a4c8d6c6bcec6537d066e9d1db668561c33703c242/files/lib/libselinux.so.1: no version information available (required by /lib64/libsubid.so.5)
podman: ~/.local/share/flatpak/app/dev.zed.Zed/x86_64/test/aaad149d20296c70002848a4c8d6c6bcec6537d066e9d1db668561c33703c242/files/lib/libselinux.so.1: no version information available (required by /lib64/libsemanage.so.2)
Trying to pull localhost/node_j-a955688a66175f03-features:latest...
time="2026-05-30T14:20:37-07:00" level=warning msg="Failed, retrying in 1s ... (1/3). Error: initializing source docker://localhost/node_j-a955688a66175f03-features:latest: pinging container registry localhost: Get \"https://localhost/v2/\": dial tcp [::1]:443: connect: connection refused"
time="2026-05-30T14:20:38-07:00" level=warning msg="Failed, retrying in 1s ... (2/3). Error: initializing source docker://localhost/node_j-a955688a66175f03-features:latest: pinging container registry localhost: Get \"https://localhost/v2/\": dial tcp [::1]:443: connect: connection refused"
time="2026-05-30T14:20:39-07:00" level=warning msg="Failed, retrying in 1s ... (3/3). Error: initializing source docker://localhost/node_j-a955688a66175f03-features:latest: pinging container registry localhost: Get \"https://localhost/v2/\": dial tcp [::1]:443: connect: connection refused"
Error: unable to copy from source docker://localhost/node_j-a955688a66175f03-features:latest: initializing source docker://localhost/node_j-a955688a66175f03-features:latest: pinging container registry localhost: Get "https://localhost/v2/": dial tcp [::1]:443: connect: connection refused
2026-05-30T14:20:45-07:00 ERROR [dev_container::devcontainer_manifest] Non-success status from docker run. StdErr: podman: ~/.local/share/flatpak/app/dev.zed.Zed/x86_64/test/aaad149d20296c70002848a4c8d6c6bcec6537d066e9d1db668561c33703c242/files/lib/libselinux.so.1: no version information available (required by /lib64/libsubid.so.5)
podman: ~/.local/share/flatpak/app/dev.zed.Zed/x86_64/test/aaad149d20296c70002848a4c8d6c6bcec6537d066e9d1db668561c33703c242/files/lib/libselinux.so.1: no version information available (required by /lib64/libsemanage.so.2)
Error: creating container storage: creating an ID-mapped copy of layer "e88f396e182763ca447f810caafee0b7b8b699747116a526ddfc374bf86b8a4e": storage-chown-by-maps: ~/.local/share/flatpak/app/dev.zed.Zed/x86_64/test/aaad149d20296c70002848a4c8d6c6bcec6537d066e9d1db668561c33703c242/files/lib/libselinux.so.1: no version information available (required by /lib64/libsubid.so.5)
storage-chown-by-maps: ~/.local/share/flatpak/app/dev.zed.Zed/x86_64/test/aaad149d20296c70002848a4c8d6c6bcec6537d066e9d1db668561c33703c242/files/lib/libselinux.so.1: no version information available (required by /lib64/libsemanage.so.2)
2026-05-30T14:20:45-07:00 ERROR [recent_projects::remote_servers] Failed to start dev container: DevContainerUpFailed("Failed with nested error: CommandFailed(\"podman\")")
Thanks for getting this working! I'm excited to use dev containers! |
I ran into the same issue on popOS 24.04LTS from what I understand blue42u isn't too keen on getting into the sandbox on vs sandbox off debate but personally I'm not a fan of the current setup as to my mind having dev containers fail out of the box eliminates the ease of use argument of sandbox off while also providing worse security defaults. Currently flatpak is a rather bodgey system so it's very impressive that @blue42u has been able to get this to work nicely at all. There is currently a project to create a new version of flatpak with improved functionality, security and rationalise the codebase. Which sounds great, though it will rely on systemd so I'm sure the whole linux community will be fine with that and there will be no controversy whatsoever. |
|
Are Podman/Docker compose supported for compose devcontainers? I just tried using podman and received the error: I also can't get devcontainer features to work. I enabled write access to Seems to be an issue with VSCode flatpak as well. But I tried Zed without flatpak and was running into the same issue. Then I found this issue in the main repo and the very recent PR to fix it. Then I tried non-flatpak Zed with podman compose. Turns out Fedora atomic desktops still require It may be related to the /tmp fix PR. Once that is merged I can test podman compose and devcontainer features. |
Short version is no, not really. Because the Zed Flatpak uses
Assuming this is the same SELinux labeling issue I reported, I worked around it by setting: # ~/.config/containers/containers.conf
[containers]
label = false
I feel the pain, but instead of disabling the sandbox unilaterally and dealing with the resulting backlash, I personally feel the way forward is to get upstream to support running sandboxed. See zed-industries/zed#56435 for one plausible feature that IMHO would help the situation. |
|
Thanks for the info on docker-compose. I'm having trouble with compose working on the non-flatpak Zed. I'm following the guide. But inside the container I have no Without compose it works and I can see my project: drwxr-xr-t. 1 root root 14 Jun 5 18:17 workspacesWith compose it does not work: drwxr-xr-x. 1 root root 162 Jun 4 17:18 workspacesI'm not sure how to have compose mount the workspaces properly. It seems the only difference is the sticky bit. Until I can get it working there's probably no point in trying further within flatpak. I'll try your workaround for the SELinux labeling issue next. And when the PR is merged we can try a new build without the workaround. EDIT: I tried But I still can't get features to work inside flatpak. I am using EDIT2: Your workaround also fixes docker compose and |
5084c74 to
a852f2a
Compare
|
🚧 Test build enqueued. |
|
🚧 Started test build. |
|
✅ Test build succeeded. To test this build, install it from the testing repository: Built for aarch64 and x86_64 architectures. |
Fixes #336. This is #340 but also installs the
dockerandpodmanCLIs, which avoids the "docker CLI not found" errors that otherwise appear when Zed attempts to start a Devcontainer.This works for me on Bluefin DX, based on Fedora 43. @Pioneer-1-1 @tomaswarynyca @acch can you give this a try?