optiopay / klar

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

Talking to ECR times out. #68

Closed sbutt closed 6 years ago

sbutt commented 6 years ago

I have been trying to get Klar to pull images from our ECR in Amazon, but it simply times out. We can perform a docker pull just fine, but Klar doesn't work.

[ec2-user@ip-??-??-123-123 ~]$ CLAIR_ADDR=$REGISTRY CLAIR_OUTPUT=High CLAIR_THRESHOLD=10 DOCKER_USER=AWS DOCKER_PASSWORD=$PASSWORD ./klar-1.5-linux-amd64 123456789.dkr.ecr.eu-west-1.amazonaws.com/postgres Get error Can't pull image: Get https://123456789.dkr.ecr.eu-west-1.amazonaws.com/v2/postgres/manifests/latest: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

Is this a problem with Klar, are are we using it in the wrong way? Should we instead be building our images locally, and then scanning using a local repo BEFORE we push into ECR?

hashmap commented 6 years ago

@sbutt No, we used Klar to check images in ECR, the only problem was the password expiration (see https://github.com/optiopay/klar#amazon-ecr-support. Could you debug connection, like curl https://123456789.dkr.ecr.eu-west-1.amazonaws.com/v2/postgres/manifests/latest (with docker user credentials)?

hashmap commented 6 years ago

@sbutt please test now, you need to build from master branch, @ppacher has just implemented configurable timeout support https://github.com/optiopay/klar/pull/94 by

hashmap commented 6 years ago

Closing because of inactivity, I hope the latest release fixed it. Let me know if the issue needs to be reopened.

sbutt commented 6 years ago

Hi, many thanks for fixing this. I've since moved on to another company so I don't have the infrastructure to test this any more. Perhaps one of the team who are still there will be able to try this?