Description:

ARTIFACTORY: How to debug ‘unknown blob’ when pulling from a local docker repository

AuthorFullName__c
Loren Yeung
articleNumber
000005281
ft:sourceType
Salesforce
FirstPublishedDate
2022-05-22T11:26:02Z
lastModifiedDate
2024-03-10T07:46:49Z
VersionNumber
5
When pulling a docker image from a local Artifactory repository or a virtual that only contains local repositories, you may get the error ‘unknown blob’:
docker pull <artifactory>:8082/docker-local/library/ubuntu:20.04
20.04: Pulling from docker-local/library/ubuntu
8e5c1b329fe3: Pulling fs layer 
error pulling image configuration: download failed after attempts=1: unknown blob

Usually, this error means that the docker manifest.json references a layer that is not present in the local repository. We can look at the manifest.json (not the list):
{
    "schemaVersion": 2,
    "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
    "config": {
        "mediaType": "application/vnd.docker.container.image.v1+json",
        "size": 1463,
        "digest": "sha256:1a437e363abfa47bfe4b3f5906b7444d12346102d944ebddd537e47a62fc6f52"
    },
    "layers": [{
        "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
        "size": 28565998,
        "digest": "sha256:8e5c1b329fe39c318c0d49821b339fb94a215c5dc0a2898c8030b5a4d091bcba"
    }]
}

And we see that there are two referenced blobs in this manifest:
Sha256:8e5c1b329fe39c318c0d49821b339fb94a215c5dc0a2898c8030b5a4d091bcba
Sha256:1a437e363abfa47bfe4b3f5906b7444d12346102d944ebddd537e47a62fc6f52

We can check the logs or the UI to see which layer is missing by searching for 404s when pulling the image:
2022-04-28T22:36:52.271Z|6895fa07e993d5c6|52.9.243.19|admin|GET|/api/docker/docker-local/v2/library/ubuntu/blobs/sha256:1a437e363abfa47bfe4b3f5906b7444d12346102d944ebddd537e47a62fc6f52|404|-1|157|5|docker/20.10.14 go/go1.16.15 git-commit/87a90dc kernel/5.10.104-linuxkit os/linux arch/amd64 UpstreamClient(Docker-Client/20.10.14 \(darwin\))


User-added image

In this case, it is 1a437e363abfa47bfe4b3f5906b7444d12346102d944ebddd537e47a62fc6f52 that is missing.