-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Problem running clair as a container in docker swarm #446
Comments
Hey there, that was a bug on master which has a lot of changes. |
Thanks, I did realise in the end that I was probably using the wrong version of the clair image, and I got clair:2.0.1 working. Chris |
Hey Chris,
That's because you probably got your sample config from the master git branch which has breaking (config) changes. You can find a sample config for a stable release on the release-2.0 branch. I'm glad to see you got things working with HEAD, though. If you find any bugs, please let us know. |
Yes, I just followed the instructions on https://github.com/coreos/clair/blob/master/Documentation/running-clair.md, to get a config file: |
I am trying to run clair as part of a docker swarm stack which runs clair, postgres and clairctl as services which can talk to each other over an overlay network.
The services all appear to run ok. The clair logs seems to show that it is running and I can see that the postgres database is populated. Requests to http://clair:6061/health from the clairctl container return HTTP 200.
But requests to http://clair:6060 are refused even though the clair container is exposing ports 6060 and 6061.
If I do "docker exec -it <container_id> sh" to see what's going on inside the clair container, I can see that it is listening on :::6060 for the health request but listening on localhost:6061 for the API.
Looking at the clair code in api/v3/server.go, I see this:
func Run(GrpcPort int, tlsConfig *tls.Config, CertFile, KeyFile string, store database.Datastore) { l, err := net.Listen("tcp", fmt.Sprintf("localhost:%d", GrpcPort))
i.e. the clair API is explicitly listening on localhost, and there's no way to override that.
All this leads me to think that what I'm trying to do will never work - is that the case?
Chris
The text was updated successfully, but these errors were encountered: