optiopay / klar

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

Use Docker Daemon to pull images instead of querying via HTTP call #148

Open RiceBowlJr opened 5 years ago

RiceBowlJr commented 5 years ago

Hi,

I am using (trying to at least) Klar/Clair in Jenkins X (in AWS EKS). I made a Klar image with DinD and the ECR helper tool. With this image I am able to build Docker images and push them to an ECR repository via an IAM role set on the EC2 instance and the ECR credential helper directly called by the Docker daemon via the ~/.docker/config.json (have a look at the README.md. But Klar isn't using the Docker Daemon to pull the image from ECR so I cannot pull the images except if I set a dirty login script to pass the credentials in the env var.

After looking a bit into the code, I see that you implemented your own Docker library, wouldn't it easier/better to use the Docker/Moby library instead ? This might make my CI work 😃

I am far from being a developer, but I took a look at this and I think this is the way to do it: https://gist.github.com/miguelmota/4980b18d750fb3b1eb571c3e207b1b92

I would be happy to help with my little knowledge.

hashmap commented 5 years ago

One of the initial requirements for Klar was ability to run on a machine without docker. Reusing docker codebase might be a good idea.

sergitei commented 5 years ago

Another very useful feature would be to make the latest build available with the name "klar-latest-linux-amd64". We could apply automation (e.g. curl) making sure we are always working with the latest image. I wonder if this is something being considered in the short term?