spec icon indicating copy to clipboard operation
spec copied to clipboard

Wait for container initialization before devcontainer setup

Open darsor opened this issue 1 year ago • 1 comments

I'm using a container that has its own init system. Part of the init process of the container is to create the container user. I'm running into an issue where the devcontainer implementation starts trying to get information about the remoteUser before that user is even created.

Is there any method to block first-time container inspection/setup until a command finishes? I was hoping to use onCreateCommand for this, but it is run after the container is probed, not immediately after it is created.

#299 might solve this issue.

darsor avatar Mar 28 '24 17:03 darsor

Hi 👋

Currently, there is no built-in method in Dev Container configuration to block the setup process until a certain command finishes. The onCreateCommand is indeed run after the container is probed, not immediately after it is created.

https://github.com/devcontainers/spec/issues/299 might solve this issue.

This would definitely help you.

In the meanwhile, can you create the user as part of your Dockerfile or a local Feature? Using https://github.com/devcontainers/features/tree/main/src/common-utils might be helpful as well.

samruddhikhandale avatar Mar 29 '24 22:03 samruddhikhandale