optiopay / klar

Integration of Clair and Docker Registry
MIT License
506 stars 138 forks source link

Analyzing a local image fails with `Can't pull image: Token request returned 401` #5

Closed wombat closed 7 years ago

wombat commented 7 years ago

I tried to analyze a local Docker image on macOS using Docker for Mac and it failed with the following error: Can't pull image: Token request returned 401

In the near future we would like to use klar inside a dind container, after building the Docker image and before pushing it into our internal registry.

hashmap commented 7 years ago

Klar was designed to work only with remote repository, for local images you may want to use https://github.com/coreos/clair/tree/master/contrib/analyze-local-images

ye commented 6 years ago

@hashmap The link you provided above is giving me a 404 error. Can you elaborate why local images won't work? Or in other words, why does Klar requires a remote docker registry credential in order for it to work?

supereagle commented 6 years ago

According to clair/Documentation/integrations.md, analyze-local-images is a deprecated tool to analyze local Docker images.

The link you provided above is giving me a 404 error.

Docker registry credential is only needed with your security Docker registry.

Or in other words, why does Klar requires a remote docker registry credential in order for it to work?

hashmap commented 6 years ago

The link was posted a year ago. It was moved to https://github.com/coreos/analyze-local-images The beginning of Klar's readme file says Klar. Integration of Clair and Docker Registry, so analyse of local images is just out of scope. We built the tool with a narrow use case in mind. Potentially it could be extended to analyze local images, the main value would be check before pushing to the registry. However it would require some serious coding effort, klar needs to emulate docker registry.

ye commented 6 years ago

@supereagle @hashmap thanks and fair enough.