Problem
The dev container is slow to load. After creation, the postCreateCommand (bash .devcontainer/post-create.sh) takes a few minutes to finish, blocking productive use of the workspace.
Repro
- Open the repo in a fresh dev container (Codespaces or VS Code Dev Containers).
- Wait through container build + features install.
- Observe
post-create.sh running for several minutes before the environment is usable.
Root cause analysis
.devcontainer/post-create.sh runs three relatively heavy installs sequentially on every container creation:
- Checkov —
pip install --user --only-binary :all: checkov — large package with many transitive deps.
- PSRule.Rules.Azure —
Install-Module ... -Scope CurrentUser -Force — pulls a large module from the PowerShell Gallery.
- ARM-TTK —
git clone --depth 1 https://github.com/Azure/arm-ttk.git — network clone every time.
All three steps run serially and re-execute on every container rebuild, because they live in postCreateCommand rather than being baked into the image or cached via onCreateCommand / prebuilds.
Suggested fixes
Acceptance criteria
- Time from "container created" to "ready to use" is significantly reduced (target: <30s steady state).
- All existing tools (Checkov, PSRule.Rules.Azure, ARM-TTK) remain available with equivalent versions/behavior.
post-create.sh (or its replacement) is idempotent
Problem
The dev container is slow to load. After creation, the
postCreateCommand(bash .devcontainer/post-create.sh) takes a few minutes to finish, blocking productive use of the workspace.Repro
post-create.shrunning for several minutes before the environment is usable.Root cause analysis
.devcontainer/post-create.shruns three relatively heavy installs sequentially on every container creation:pip install --user --only-binary :all: checkov— large package with many transitive deps.Install-Module ... -Scope CurrentUser -Force— pulls a large module from the PowerShell Gallery.git clone --depth 1 https://github.com/Azure/arm-ttk.git— network clone every time.All three steps run serially and re-execute on every container rebuild, because they live in
postCreateCommandrather than being baked into the image or cached viaonCreateCommand/ prebuilds.Suggested fixes
onCreateCommandinstead ofpostCreateCommandfor heavy/static installs.&+wait).Acceptance criteria
post-create.sh(or its replacement) is idempotent