Skip to content

Add Zed to docs about Dev Containers#6732

Open
deevroman wants to merge 1 commit intoopenstreetmap:masterfrom
deevroman:zed
Open

Add Zed to docs about Dev Containers#6732
deevroman wants to merge 1 commit intoopenstreetmap:masterfrom
deevroman:zed

Conversation

@deevroman
Copy link
Copy Markdown
Contributor

Zed added support for Dev Containers in January of 2026. I tested the work of Dev Containers with this repository and the only remark is that Zed opens the terminal from under the root user, which is why you get an error:

env: ‘ruby’: No such file or directory

and mise: not found

Added information about this to Troubleshooting

@tomhughes
Copy link
Copy Markdown
Member

The whole point of dev containers was supposed to be that they provide a portable description of how to run things that can work across environments but between apparently needing an entirely different definition for codespaces and starting to fill up the documentation with a series of environment specific hacks it seems they are failing to fulfill that 😞

@deevroman
Copy link
Copy Markdown
Contributor Author

It seems to me that the problem is either somewhere near this setting

// Uncomment to connect as root instead. More info: https://containers.dev/implementors/json_reference/#remoteUser.
// "remoteUser": "root",

Either in .devcontainer/Dockerfile, where the root user is specified by default

However, I'm not good at Dev Containers configuration. Maybe even a feature freshness issue in Zed


Anyway it's a small thing compared to the fact that this is the first time I've been able to get fully green tests on a Mac with Arm, without using Rosetta:

@deevroman
Copy link
Copy Markdown
Contributor Author

deevroman commented Jan 22, 2026

Well, I was glad early. There is also a difference between dev containers in VSCode and Zed.

The documentation suggests using bundle exec rails s to start the web server, and it starts on http://127.0.0.1:3000. At the same time, in compose.yaml port forwarding is not configured. It is configured via devcontainer.json using "forwardPorts": [3000, 5432]. VSCode does some magic, and at the moment when you start the server insists on forwarding the port.

That is, for Zed, I had to add it to compose.yaml

ports:
      - "3000:3000"

And start the server with the -b '0.0.0.0' flag

@pablobm
Copy link
Copy Markdown
Contributor

pablobm commented Jan 28, 2026

OK, "VSCode does some magic" might be the issue here. It could be that different IDEs are trying to be smart and do things that are neither on the common spec nor advertised by themselves. So if we slowly get things to work in different tools, it might solve things for others.

I'm trying to test with Zed in a machine where I have it installed... but now VSCode is not working there 😡 I'll come back to this in a few days when my blood pressure is lower.

@pablobm
Copy link
Copy Markdown
Contributor

pablobm commented Feb 3, 2026

Had another look. It appears that VSCode creates a vscode user behind the scenes, also making it into a sudoer. I haven't tried, but seems like we could replicate this for other IDEs by doing it explicitly in the Dockerfile: https://code.visualstudio.com/remote/advancedcontainers/add-nonroot-user#_creating-a-nonroot-user

@gravitystorm gravitystorm added the dx Developer Experience label Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dx Developer Experience

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants