GitHub Codespaces devcontainer.json postCreateCommand execution consistency
0 reputation · 14 Jul 2022, 04:57 UTC
GitHub Codespaces relies on the devcontainer.json configuration to ensure a repeatable development environment. A key component of this setup is the postCreateCommand, which is intended to automate the final steps of environment preparation, such as installing dependencies or configuring local databases.
There is uncertainty regarding the exact trigger conditions for this command when a codespace is transitioned between different states. Specifically, it is unclear if the command executes only during the initial container build or if it triggers upon the resumption of a stopped codespace that has undergone a configuration update.
- Does the
postCreateCommandrun automatically when a codespace is started from a stopped state if thedevcontainer.jsonwas modified? - What is the expected behavior for this command when a user performs a full rebuild versus a simple restart of the container?