Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

403 errors fetching layer size information from Docker Hub #77

Open
rossf7 opened this issue Jun 10, 2020 · 0 comments
Open

403 errors fetching layer size information from Docker Hub #77

rossf7 opened this issue Jun 10, 2020 · 0 comments

Comments

@rossf7
Copy link
Contributor

rossf7 commented Jun 10, 2020

Since late 2019 the method we use to fetch the size of image layers from Docker Hub has been broken for most images.

We don't have a solution but we've now open sourced the Micro Badger code. So the problem is clear and in the hope the community can help with fixing it.

We make a HEAD request instead of a GET request to get the layer size. This is more efficient and is necessary because layers can be very large. This still works for ADD commands in Dockerfiles but for RUN commands and several others we get 403 responses.

For some simple images like alpine the inspection process still works but for most images it fails. The relevant code is here and the problem can be reproduced locally with Docker Compose.

Run code

  • Clone the repo and follow the steps in the README.
  • In the .env file enable debug logging for the mminspect module.
MB_LOG_DEBUG=mminspect

Fetch image

  • Get an image with some RUN commands like our microscaling image.
curl http://localhost:8080/v1/images/microscaling/microscaling
  • In the logs there will be errors like the following.
size_1       | DEBU 09:21:37.339:  Getting blob at URL https://registry.hub.docker.com/v2/microscaling/microscaling/blobs/sha256:89712a38aad7478fa618c6c87e088bd53bfbaf74772c6cdccb3aa40f5d030e38
size_1       | DEBU 09:21:37.678:  Req failed: 403 403 Forbidden
size_1       | ERRO 09:21:37.678:  Failed to get blob: Req failed: 403 403 Forbidden
size_1       | INFO 09:21:37.678:  Error getting blob size for image microscaling/microscaling blob sha256:89712a38aad7478fa618c6c87e088bd53bfbaf74772c6cdccb3aa40f5d030e38: Req failed: 403 403 Forbidden
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant