-
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
Connection refused between docker container of clair and pgsql #134
Comments
Did you fill the pgsql setting in your config.yaml file and started with it?
|
yes,like this and I run the postgresql container with
|
|
I run the two container on the same host machine. |
I run both successfully on the same machine with DockerCompose and changed source to Try not specifying a database name. |
I use the following to run the Clair container, referring to clair/README.md https://github.com/coreos/clair/blob/master/README.md
And I also tried to run postgresql directly on the host machine, but get the same err as mentioned above. |
It is more important how the postgres container is running. Instead of localhost, use the alias "postgres". If you run "docker inspect" on your postgres container, you should see the alias "postgres", and that port 5432 is open for tcp. If you don't see alias "postgres" or port 5432 open for tcp, then you need to use the host or alias and port that is open for you to connect. |
And now the logs change to
|
"docker inspect" the postgres container. If you don't see alias "postgres" or port 5432 open for tcp, then you need to use the host or alias and port that is open for connection. The error shows dns can't find the alias. The DockerCompose instructions in the README.md will set up a postgres container for you with the right alias, I recommend it for testing. |
Thanks for answering my questions and helping me. If I check the netstat, I can see the following result.
I will try DockerCompose, but I still wonder if there is any solution for the docker method? |
Hi, I started PostgreSQL using the command you shared above. Note that I am using
Host may vary depending on your Docker setup. |
Same here, even with the fully decoupled config proposed by @Quentin-M. Works with Clair RC1 |
Actually, could you show me your entire config file please? You must have a clair root key now in your config: https://github.com/coreos/clair/blob/master/config.example.yaml#L16 |
@Quentin-M for that's the problem. Fixed with the root key. Wrong config loading should output something isn't it? |
When a wrong config file was used, it result in a panic. Adding some check condition to validate the Unmarshaled configuration before using it fixes quay#134
I've opened a #140 to return an understandable error when config is not loaded properly. |
@GabrielleLC See my answer above, I believe that it's going to fix your issue. |
* config: not properly loaded error When a wrong config file was used, it result in a panic. Adding some check condition to validate the Unmarshaled configuration before using it fixes #134 * check if datasource is set * move error locally instead of utils/errors
Closed by the merge above. Feel free to re-open if necessary. |
I am facing the same issue Creating network "go_default" with the default driver
I don't have any other postgres running on 5432. my docker-compose.yml below
Any luck ? |
Faced the same problem. Figured out that connection URL to the database should not be |
This one worked..after several hours of struggle. |
When I try to run the docker container of clair, there is something wrong with the connection to my pgsql. The docker logs are quoted as follows.
I have tried several ways and on different machines and the issue still exists.
The text was updated successfully, but these errors were encountered: