DockerImageAsset: environmental variables
Describe the feature
Is it possible to include environmental variables in the docker build? I don't see it included here: https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk.aws_ecr_assets/DockerImageAsset.html
Use Case
I would like to include the following env vars when building docker images with CDK:
DOCKER_BUILDKIT=1
CDK_DOCKER=finch
Proposed Solution
No response
Other Information
No response
Acknowledgements
- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change
CDK version used
latest
Environment details (OS name and version, etc.)
MacOS
Is it possible to do this with docker build?
As is, I would need to add to the app instructions to export these env vars before calling CDK deploy.
Does it help to export that before the cdk deploy like?
export DOCKER_BUILDKIT=1
npx cdk synth
@pahud Sure it works to explicitly export env vars, but I was hoping they could be defined in the build process.
any updates on this? Sounds like an important feature to have.