-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Handle Build Args in ContainerImage.fromAsset() #1271
Comments
It could be, but I'm curious as to what the types of arguments are you would be wanting to pass. Could you tell us a little about your use case? |
Generally any build time configuration values. For me these are values that we need present during build steps. Stuff like the NODE_ENV environment variable for when we precompile static assets in the container. Ours is a rails app, and unfortunately when running build steps in rails it expects all environment variables to be set. So we have a set of "build" environment variables that we need to pass in. |
I'm in the same boat. Needing to pass an NPM_TOKEN variable as an ARG to install node modules from a private repo. |
Another use case is to pass a port to |
@rix0rrr would you accept a PR for this? |
When building a docker container locally and deploying that image, it would be useful to be able to pass build args to the
ecs.ContainerImage.fromAsset()
constructor.As far as I can tell this could go something like adding a "buildArgs" property to the
DockerImageAssetProps
interface which would be an object (key/val pairs). These would flow through toDockerImageAsset
in @aws-cdk/assets-docker and be added to the asset metadata.Then, when building containers during deployment in aws-cdk/lib/docker.js
There are other docker build CLI options that may be useful to handle similarly, looking through the list, maybe "target" to allow users to specify a specific stage to be built in a multi stage build.
Does this seem like something cdk should allow?
The text was updated successfully, but these errors were encountered: