-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(ecr-assets): image with variable buildArgs being rebuilt every time #15936
Comments
sourceHash is readonly. Would making it modifiable fix the issue, then it can be modified post construction? |
Docker build args are meant for build system specific configuration like http proxy or CodeArtifact tokens. Give the user an option to not hash build args so the DockerImageAsset hash can remain consistent. An inconsistent hash means the asset is built every synth and that wastes time and space. closes aws#15936
A |
Docker build args are meant for build system specific configuration like http proxy or CodeArtifact tokens. Give the user an option to not hash build args so the DockerImageAsset hash can remain consistent even when using build args. An inconsistent hash means the asset is built every synth and that wastes time and space. This change is backwards compatible as the default hashing behavior remains the same. closes #15936 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Docker build args are meant for build system specific configuration like http proxy or CodeArtifact tokens. Give the user an option to not hash build args so the DockerImageAsset hash can remain consistent even when using build args. An inconsistent hash means the asset is built every synth and that wastes time and space. This change is backwards compatible as the default hashing behavior remains the same. closes #15936 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Docker build args are meant for build system specific configuration like http proxy or CodeArtifact tokens. Give the user an option to not hash build args so the DockerImageAsset hash can remain consistent even when using build args. An inconsistent hash means the asset is built every synth and that wastes time and space. This change is backwards compatible as the default hashing behavior remains the same. closes aws#15936 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
#5705 made DockerImageAsset generate the asset hash based on, among other things, the
buildArgs
argument. This means that if build arg is used for anything dynamic the image will be rebuilt for every synth.Can we have another argument allowing to control the hashing of
buildArgs
? MaybehashBuildArgs
that defaults totrue
?Use Case
When CDK keeps hashing these build-machine specific arguments, it keeps generating new assets even though the intention is to have the same hash across build machines.
Proposed Solution
hashBuildArgs
argument that defaults totrue
to maintain the current behavior. It can then be used here.Other
The PR that made this caused this issue is #5705
This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: