-
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
aws-ecr: Unable to execute 'docker' in order to build a container asset, even when docker is installed and available #29883
Comments
This error indicates cdk can't find Are you installing docker in a special directory? Is it in your system $PATH? |
Since yesterday, I have the same issue. It is very annoying, all the time thinking it is something about my CDK code or my Docker image in which I have installed the CDK. I have Docker Desktop also installed and I use WSL for running the container. |
I was wrong to assume that
(mac) |
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
This problem is still open. My workaround is to create a CodePipeline that reads from the repo and dockerizes the image and puts it into ECR. It's a PITA workaround though since dealing with Github permissions can be really annoying in Organizations where you're not an admin. |
I'm having this same issue when publishing Docker images inside a CodeBuild environment. I'll have several successful builds, and then seemingly randomly it will stop working. I'm using AWS Amplify Gen2. Here's the code snippet which creates a Lambda function backed by a docker image. const queryReportImageLambdaPy = new lambda.DockerImageFunction(customStack, 'QueryReportImagesPy', {
code: lambda.DockerImageCode.fromImageAsset(path.join(
__dirname, 'functions', 'getInfoFromPdfPy'
)),
timeout: cdk.Duration.minutes(15),
memorySize: 3000,
role: queryReportsLambdaRole,
environment: {
'DATA_BUCKET_NAME': dataBucketName,
// 'MODEL_ID': 'anthropic.claude-3-sonnet-20240229-v1:0',
'MODEL_ID': 'anthropic.claude-3-haiku-20240307-v1:0',
'MAX_TOKENS': '4096'
}
}); Here's a snippet from the CodeBuild log:
My issue may be related to the build image used by AWS Amplify: |
Describe the bug
When attempting to deploy a test stack with a basic DockerImageAsset, it fails with the error:
fail: Unable to execute 'docker' in order to build a container asset. Please install 'docker' and try again
. Docker is installed, accessible via terminal, and the daemon is running.Expected Behavior
This should deploy, or it should print out a more understandable error for triaging.
Current Behavior
Using the
--verbose
flag, the following trace log is outputted:This occurs even after running
aws ecr get-login-password | docker login --username AWS --password-stdin https://{account-id}.dkr.ecr.us-east-1.amazonaws.com
beforecdk synth
. Upon further testing,docker image build
, and other docker commands work just fine running from the same terminal.Reproduction Steps
At the core, the related ECR code for the stack is:
The
./src
folder, just contains aDockerfile
setup as follows:with the the
test.py
file being:Running
aws ecr get-login-password | docker login --username AWS --password-stdin https://{account-id}.dkr.ecr.us-east-1.amazonaws.com
beforecdk synth
can be an option, but doesn't seem to change behavior.Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.137.0 (build bb90b4c)
Framework Version
No response
Node.js Version
v18.8.0
OS
Windows 10 Home Version 10.0.19045 Build 19045
Language
Python
Language Version
Python 3.10.7
Other information
No response
The text was updated successfully, but these errors were encountered: