Speed up devcontainer creation by parallelizing tool installs and moving them into the prebuild#36
Merged
sendtoshailesh merged 1 commit intoApr 28, 2026
Conversation
Container creation was slow because post-create.sh ran three sequential installs (Checkov, PSRule.Rules.Azure, arm-ttk) on every create, outside the prebuild. - devcontainer.json: switch postCreateCommand -> onCreateCommand so the work is captured by Codespaces prebuilds and doesn't re-run on each create. - post-create.sh: run the three independent installs in parallel; wall time is roughly the slowest step instead of the sum. - Faster flags: pwsh -NoProfile, Install-Module -AcceptLicense -SkipPublisherCheck; pip --no-compile --disable-pip-version-check; git clone --single-branch --filter=blob:none. - Idempotent: skip steps when checkov is on PATH, PSRule.Rules.Azure is listed, arm-ttk.psd1 exists, or the profile import line is already present - re-runs (rebuild on existing volume) are near-instant. - Failure attribution: each background job logs to its own file; on failure the script reports which install failed and its exit code. Fixes Azure#35
sendtoshailesh
approved these changes
Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Container creation was slow because
post-create.shran three sequential installs (Checkov, PSRule.Rules.Azure, arm-ttk) on every create, outside the prebuild.Changes
devcontainer.json: switchpostCreateCommand→onCreateCommandso the work is captured by Codespaces prebuilds and doesn't re-run on each create.post-create.sh: run the three independent installs in parallel; wall time ≈ slowest step instead of the sum.pwsh -NoProfile,Install-Module -AcceptLicense -SkipPublisherCheck;pip --no-compile --disable-pip-version-check;git clone --single-branch --filter=blob:none.checkovis on PATH,PSRule.Rules.Azureis listed,arm-ttk.psd1exists, or the profile import line is already present — re-runs (rebuild on existing volume) are near-instant.Fixes #35