Skip to content
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-assets: DockerImageAsset is unusable with Docker Buildkit builder, which is the default in recent Docker for Mac #21990

Open
lox opened this issue Sep 10, 2022 · 1 comment
Labels
@aws-cdk/aws-ecr-assets Related to AWS CDK Docker Image Assets bug This issue is a bug. effort/medium Medium work item – several days of effort p2

Comments

@lox
Copy link

lox commented Sep 10, 2022

Describe the bug

BuildKit is the default builder on Docker for Mac and DockerImageAsset doesn't appear to set an output, so builds will fail as they aren't saved to the local docker registry (only build cache by default).

Expected Behavior

DockerImageAsset should either configure output=docker or correctly use Buildkit to push to the ECR Repository when Buildkite is the default builder.

Current Behavior

Building on a mac with a recent Docker for Mac (mine is 4.0.1), deploy will fail with this error:

Error response from daemon: No such image: cdkasset-ba6f83a156c20286cbce8a4f5c837ca1a2a4e01d9b3de43cc6e9c2fa4a6e6fc0:latest

and a warning earlier that makes it clear the issue:

time="2022-09-10T12:52:04+10:00" level=warning msg="No output specified for docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load"

Reproduction Steps

const image = new ecrAssets.DockerImageAsset(this, 'DockerImage', {
  directory: path.join(__dirname, '/../docker/agent'),
});

Possible Solution

This could possibly be worked around with supporting --output, although given Buildkit is likely the future default, this seems like a bad option.

Additional Information/Context

This is mentioned in #12472 (comment) and #20566, but neither of the comments make it clear that this is essentially a show stopper (without good workarounds) for anyone on a recent Docker for Mac.

CDK CLI Version

2.39.1 (build f188fac)

Framework Version

No response

Node.js Version

v18.8.0

OS

macOS 12.4

Language

Typescript

Language Version

No response

Other information

No response

@lox lox added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 10, 2022
@github-actions github-actions bot added the @aws-cdk/aws-ecr-assets Related to AWS CDK Docker Image Assets label Sep 10, 2022
@lox lox changed the title aws-ecr-assets: DockerImageAsset is unusable with recent Docker for Mac aws-ecr-assets: DockerImageAsset is unusable with Docker Buildkit builder, which is the default in recent Docker for Mac Sep 10, 2022
@peterwoodworth peterwoodworth added p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Dec 13, 2022
@ulili5
Copy link

ulili5 commented May 24, 2023

Here's how you can mitigate it. Install docker-buildx

brew install docker-buildx

Link buildx

ln -sfn $(which docker-buildx) ~/.docker/cli-plugins/docker-buildx

@madeline-k madeline-k removed their assignment Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-ecr-assets Related to AWS CDK Docker Image Assets bug This issue is a bug. effort/medium Medium work item – several days of effort p2
Projects
None yet
Development

No branches or pull requests

4 participants