-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
‼️ NOTICE: DockerImageAsset and ContainerImage 'file' property breaks docker image building #6954
Labels
Comments
MrArnoldPalmer
added a commit
to MrArnoldPalmer/aws-cdk
that referenced
this issue
Mar 24, 2020
Prior v1.29.0, the context passed to the docker build command was always the current working directory. In v1.29.0, this was changed to be the directory the user passed when instantiating the asset. However, docker doesn't respect the context passed to the build command when the `--file` argument is also passed. This broke assets for users passing the `file` prop when constructing a `DockerImageAsset`. This is fixed by changing the current working directory of the `docker build` command and passing that context as '.'. Then docker uses the current working directory as the context and correctly finds the image definition file from the `file` prop. An existing integration test in the framework covers this case, but does not fail unless the stack is deployed fresh since the asset isn't rebuilt when the hash is not changed. Fix: aws#6954 aws#6814
MrArnoldPalmer
added a commit
to MrArnoldPalmer/aws-cdk
that referenced
this issue
Mar 24, 2020
Prior v1.29.0, the context passed to the docker build command was always the current working directory. In v1.29.0, this was changed to be the directory the user passed when instantiating the asset. However, docker doesn't respect the context passed to the build command when the `--file` argument is also passed. This broke assets for users passing the `file` prop when constructing a `DockerImageAsset`. This is fixed by changing the current working directory of the `docker build` command and passing that context as '.'. Then docker uses the current working directory as the context and correctly finds the image definition file from the `file` prop. An existing integration test in the framework covers this case, but does not fail unless the stack is deployed fresh since the asset isn't rebuilt when the hash is not changed. Fix: aws#6954 aws#6814
MrArnoldPalmer
added a commit
to MrArnoldPalmer/aws-cdk
that referenced
this issue
Mar 24, 2020
Prior v1.29.0, the context passed to the docker build command was always the current working directory. In v1.29.0, this was changed to be the directory the user passed when instantiating the asset. However, docker doesn't respect the context passed to the build command when the `--file` argument is also passed. This broke assets for users passing the `file` prop when constructing a `DockerImageAsset`. This is fixed by changing the current working directory of the `docker build` command and passing that context as '.'. Then docker uses the current working directory as the context and correctly finds the image definition file from the `file` prop. An existing integration test in the framework covers this case, but does not fail unless the stack is deployed fresh since the asset isn't rebuilt when the hash is not changed. Fix: aws#6954 aws#6814
MrArnoldPalmer
added a commit
to MrArnoldPalmer/aws-cdk
that referenced
this issue
Mar 24, 2020
Prior v1.29.0, the context passed to the docker build command was always the current working directory. In v1.29.0, this was changed to be the directory the user passed when instantiating the asset. However, docker doesn't respect the context passed to the build command when the `--file` argument is also passed. This broke assets for users passing the `file` prop when constructing a `DockerImageAsset`. This is fixed by changing the current working directory of the `docker build` command and passing that context as '.'. Then docker uses the current working directory as the context and correctly finds the image definition file from the `file` prop. An existing integration test in the framework covers this case, but does not fail unless the stack is deployed fresh since the asset isn't rebuilt when the hash is not changed. Fix: aws#6954 aws#6814
mergify bot
pushed a commit
that referenced
this issue
Mar 24, 2020
Prior v1.29.0, the context passed to the docker build command was always the current working directory. In v1.29.0, this was changed to be the directory the user passed when instantiating the asset. However, docker doesn't respect the context passed to the build command when the `--file` argument is also passed. This broke assets for users passing the `file` prop when constructing a `DockerImageAsset`. This is fixed by changing the current working directory of the `docker build` command and passing that context as `.`. Then docker uses the current working directory as the context and correctly finds the image definition file from the `file` prop. An existing integration test in the framework covers this case, but does not fail unless the stack is deployed fresh since the asset isn't rebuilt when the hash is not changed. Fix: #6954 #6814
This was closed because the PR was merged, im reopening because it hasn't been released yet. Once the release happens we can notify that an upgrade will resolve this problem for users. |
shivlaks
pushed a commit
that referenced
this issue
Mar 24, 2020
Prior v1.29.0, the context passed to the docker build command was always the current working directory. In v1.29.0, this was changed to be the directory the user passed when instantiating the asset. However, docker doesn't respect the context passed to the build command when the `--file` argument is also passed. This broke assets for users passing the `file` prop when constructing a `DockerImageAsset`. This is fixed by changing the current working directory of the `docker build` command and passing that context as `.`. Then docker uses the current working directory as the context and correctly finds the image definition file from the `file` prop. An existing integration test in the framework covers this case, but does not fail unless the stack is deployed fresh since the asset isn't rebuilt when the hash is not changed. Fix: #6954 #6814
v1.31.0 has been released. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Please add your +1 👍 to let us know you have encountered this
Status: IN-PROGRESS
Affected Versions:
1.29.0
,1.30.0
.Overview:
Using the
file
property in:Breaks the
docker build
because docker fails to find theDockerfile
. This also happens in theDockerImageAsset
construct.We suspect this commit introduced the problem in version
1.29.0
.Complete Error Message:
Workaround:
The current workaround is to revert back to version
1.28.0
.Solution:
Related Issues:
Originally reported here: #6814
The text was updated successfully, but these errors were encountered: