Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Layer paths for local repos #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

leopoldodonnell
Copy link

The current implementation of the layer push code replaces the repository endpoint with the local IP. This works great for images that are being pulled from docker hub or have no repository component to their tags. It fails when the image is local, but there is a registry endpoint. If the remote registry model worked in all cases, this change would not be necessary. For the time being, it appears that clairctl doesn't work with ECR credentials, so the --local route is necessary.

The current implementation of the layer push code replaces the repository endpoint with the local IP. This
works great for images that are being pulled from docker hub or have no repository component to their tags.
It fails when the image is local, but there is a registry endpoint. If the remote registry model worked in all
cases, this change would not be necessary. For the time being, it appears that clairctl doesn't work with ECR
credentials, so the `--local` route is necessary.
@jgsqware
Copy link
Owner

Thanks for your contribution.

For the credential problem, Clairctl use the docker login command to log into the registry. So have you logged you before with docker login?

@ehaselwanter
Copy link

hm. since I still struggle with the same problem (analysing images from a private repo) I tried this patch too. not working for me ... @leopoldodonnell did you miss to include another change?

with

clairctl analyze --local <registry>/image:0.0.2-rc1-3 --log-level debug
2017-05-11 12:21:15.690227 D | config: interface provided, looking for eth0
2017-05-11 12:21:15.690556 I | clair: using http://10.61.61.23:0/local as local url
2017-05-11 12:21:15.697890 D | server: Update local server port from "0" to "52595"
2017-05-11 12:21:15.698220 I | server: Starting Server on 10.61.61.23:52595

but

2017-05-11 12:21:16.008731 W | detectors: could not download layer: Get http://10.61.61.23:0/local/<id>/layer.tar: dial tcp 10.61.61.23:0: getsockopt: connection refused
2017-05-11 12:21:16.010554 E | worker: layer 7563c5fe78c2cd1cb9c58b3333df4cb1cd5764fb81b22bdab673767b0aedb82a:

port 0 is definitely not the one we want to request something from

@jgsqware
Copy link
Owner

The server ip is in fact not correct, I will fix this PR.

@jgsqware
Copy link
Owner

@leopoldodonnell here is a patch to apply to your PR, that should work,

fix_local_server_ip.patch.txt

@jgsqware jgsqware force-pushed the master branch 3 times, most recently from 64edd0f to 29a1925 Compare May 29, 2017 09:06
@lcgkm
Copy link
Contributor

lcgkm commented Jun 15, 2017

Reference #52

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants