-
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
DockerImageAsset is missing build context #3342
Comments
I'm going to need more context. |
If the folder your docker file is in requires files outsite site folder (up in the fs hierarchy) you need to define a build context. |
@rix0rrr a good use case for this (at least IMO) is when you have multiple Dockerfiles and they each use the same build context. I'm building a selenium testing environment where I have chrome and firefox images that I want to utilize the same set of nodejs scripts to handle running (protractor, cucumber, etc etc etc) and I want to manage them both in the same CDK project without having to copy the files. In that case it would be awesome to either pass a custom dockerfile location (like #3829):
Or to allow overriding |
@SomayaB please assign all asset issues to me :) |
i believe this would be a great solution to the issue i'm currently having https://stackoverflow.com/questions/58838213/allowing-stack-to-create-multiple-ecr-images |
@iliapolo do you think this is something or this will make asset staging hell? |
@eladb I think exposing the context directory might introduce a slue of unnecessary problems. I believe the issues discussed here can be better solved otherwise. @mbruning24 We have now added support for custom docker files: (#3829). Does this solve the issue you were facing? @glenfordwilliams Its been a while since your latest comment and I think the issue you addressed should now simply work. The But I think this should still be ok because i believe the initial problem was that it didn't actually create separate images based on the build args, right? |
Closing for now since there hasn't been a response in a while. Feel free to reopen. |
I know this is closed but this just happened to me today. For example if you are trying to build a Docker image from a VS C# project, the context has to be set to
It is currently not possible to do this with |
Would be great, if this could get reopened again. // LambdaWebApp = a Custom Construct imported from an npm-dependency
import { LambdaWebApp } from "common-infra-lib";
new LambdaWebApp(this, "test", {
code: cdk.aws_lambda.DockerImageCode.fromImageAsset(
// This is the build context with the source code:
"..", {
// This Dockerfile should rather get provided by the custom construct in the npm-dependency
// itself, but this isnt possible yet because the Dockerfile has to be placed in the build context here:
file: "ProdDockerfile",
}),
subdomain: "test",
}); |
Any updates on this would be greatly appreciated. |
+1 |
I was having the same issue and a combination of
|
this issue should be reopened as per @mluksch comment |
I'm submitting a ...
What is the current behavior?
If the current behavior is a πͺ²bugπͺ²: Please provide the steps to reproduce
Right now there is not option to specify the build context for the
docker build
.E.g. if the
Dockerfile
requires files from..
the build context need to be at least '..' instead of '.' which is the default.There should be an option to specify the context. This could be tricky, since CDK stages the files which would then mean to stage the entire build context.
It is an advanced use case for building docker images in for example mono-repositories where there are dependencies into other folders.
Please tell us about your environment:
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. associated pull-request, stackoverflow, gitter, etc)
The text was updated successfully, but these errors were encountered: