Use cacheImageName for local development environments#2328
Open
frottke wants to merge 3 commits into
Open
Conversation
Added note about local development environments using cacheImageName for artifact-specific image reuse.
Contributor
There was a problem hiding this comment.
Pull request overview
Uses cacheImageName for faster local development container creation.
Changes:
- Passes the configured image name for local environments.
- Keeps cloud behavior unchanged.
- Documents the behavior in release notes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
Actions/AL-Go-Helper.ps1 |
Forwards cacheImageName to local pipelines. |
RELEASENOTES.md |
Documents cached local images and opt-out. |
Comment on lines
+1828
to
+1831
| $imageName = "" | ||
| if ($kind -eq "local") { | ||
| $imageName = $settings.cacheImageName | ||
| } |
Comment on lines
+1829
to
+1830
| if ($kind -eq "local") { | ||
| $imageName = $settings.cacheImageName |
|
|
||
| $imageName = "" | ||
| if ($kind -eq "local") { | ||
| $imageName = $settings.cacheImageName |
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.
Summary
Use the existing
cacheImageNamesetting when creating a local development environment.CreateDevEnvcurrently passes an emptyimageNametoRun-AlPipeline, regardless of the configuredcacheImageName. As a result, local development environments cannot use the cached Business Central images already supported by AL-Go and BcContainerHelper.Problem
When
imageNameis empty, BcContainerHelper creates the container from the generic Business Central image and installs Business Central from the selected artifacts during every container creation.When a configured image name is passed, BcContainerHelper can create or reuse an artifact-specific image. Subsequent container creation can then use the prepared image instead of repeating the Business Central installation.
A local comparison demonstrated the difference:
With
imageNameset tomyBcContainerHelper found and reused the existing artifact-specific image:
The Business Central installation step was not executed again.
The complete container creation took 237 seconds in this run.
With an empty
imageNameBcContainerHelper used the generic image:
The Business Central installation alone took 209 seconds, and the complete container creation took 446 seconds in this run.
These timings are an observed example rather than a controlled benchmark, but the logs demonstrate the behavioral difference: using the cached image avoids repeating the Business Central installation when a matching image already exists.
Change
For local development environments, pass the existing
cacheImageNamesetting toRun-AlPipelineinstead of always passing an empty value.$sharedFolder = "" if ($project) { $sharedFolder = $baseFolder } + $imageName = "" + if ($kind -eq "local") { + $imageName = $settings.cacheImageName + } + Run-AlPipeline @runAlPipelineParams ` -accept_insiderEula:$accept_insiderEula ` -vsixFile $settings.vsixFile ` -pipelinename $workflowName ` - -imageName "" ` + -imageName $imageName ` -memoryLimit $settings.memoryLimit `Configuration
The existing AL-Go default remains unchanged:
{ "cacheImageName": "my" }Users who want to retain the current local development behavior can disable cached image creation in
.AL-Go/localDevEnv.settings.json:{ "cacheImageName": "" }Expected behavior
cacheImageName.my, BcContainerHelper creates or reuses an artifact-specific image.cacheImageNameto an empty string preserves the current behavior.✅ Checklist