This may be more of a buildx/buildkit question, bu...
# general
m
This may be more of a buildx/buildkit question, but I'm trying out the new
buildx
support.. I'm able to get it working with a path, but I'd like to use
type: "registry"
with ECR... Has anyone set this up successfully? Right now, I'm seeing there's an error with pulling and pushing the cache, but buildx/buildkit is not giving me more details on what the issue is... Anyone have pointers on how to debug?
1
Progress with `ldebug`:
Copy code
#6 ERROR: failed to configure registry cache importer: unexpected status from HEAD request to https://$ID.dkr.ecr.us-east-1.amazonaws.com/v2/$REG/manifests/build-cache: 401 Unauthorized
Ah, by directly using aws creds (
AWS_ACCESS_KEY_ID
, etc) instead of `AWS_PROFILE`+ecr_creds_helper, I was able to get this working. My cache_to and cache_from were:
Copy code
kwargs["cache_to"] = {
            "type": "registry",
            "ref": f"{ecr}.<http://dkr.ecr.us-east-1.amazonaws.com/{repository}:build-cache|dkr.ecr.us-east-1.amazonaws.com/{repository}:build-cache>",
            "mode": "max",
            "oci-mediatypes": "true",
            "image-manifest": "true",
            "ignore-error": "true",
        }
        kwargs["cache_from"] = {
            "type": "registry",
            "ref": f"{ecr}.<http://dkr.ecr.us-east-1.amazonaws.com/{repository}:build-cache|dkr.ecr.us-east-1.amazonaws.com/{repository}:build-cache>",
        }
👍 1
https://github.com/aws/containers-roadmap/issues/876 has more info on
image-manifest
+
oci-mediatypes