Skip to content

Commit

Permalink
more docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
neilferreira committed Sep 3, 2024
1 parent 7b361a0 commit 88edb93
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Objective

I would like to be able to use local (or registry) based build cache storage backends within my AWS CDK projects. AWS CDK creates an ECR repository as part of it's `bootstrap` process that is immutable by default. As it stands, you can not push anything to this immutable ECR repository at all once you've enabled the containerd image store in Docker.

## Reproducing the issue

To reproduce the issue within AWS ECR:

Enable the `containerd image store` as per https://docs.docker.com/build/cache/backends/ by adding the following to the Docker features:
Expand All @@ -10,6 +16,12 @@ Enable the `containerd image store` as per https://docs.docker.com/build/cache/b

ref: https://docs.docker.com/engine/storage/containerd/#enable-containerd-image-store-on-docker-engine

Create an ECR repository:

```
aws ecr create-repository --image-tag-mutability IMMUTABLE --repository-name tester
```

Sign in to AWS ECR:

```
Expand All @@ -19,17 +31,17 @@ aws ecr get-login-password --region us-east-2 | docker login --username AWS --pa
Build this image:

```
docker build -t 211125654114.dkr.ecr.us-east-2.amazonaws.com/test-immutable:bar .
docker build -t 211125654114.dkr.ecr.us-east-2.amazonaws.com/tester:bar .
```

Push this image:

```
docker push 211125654114.dkr.ecr.us-east-2.amazonaws.com/test-immutable:bar
docker push 211125654114.dkr.ecr.us-east-2.amazonaws.com/tester:bar
```

This yields:

```
failed commit on ref "manifest-sha256:b1046f6218c477a57f78da412bdf0e9225359b4f46f01a30f7929a3517a59e5f": unexpected status from PUT request to https://211125654114.dkr.ecr.us-east-2.amazonaws.com/v2/test-immutable/manifests/bar: 400 Bad Request
failed commit on ref "manifest-sha256:c464ef84ed0decc225c0913deec2153b8ef013b195ece219f890a05e96d86e1f": unexpected status from PUT request to https://211125654114.dkr.ecr.us-east-2.amazonaws.com/v2/tester/manifests/bar: 400 Bad Request
```

0 comments on commit 88edb93

Please sign in to comment.