Hi,
After having struggled, I decided to create a simplified version of a pipeline, which highlights the issue.
Environment: Linux, Jenkins 2.23, latest versions of the pipeline components.
- I build a Docker image which allows to run Postgres PSQL client, Docker & Docker Compose
- I run it with '--volume=/var/run/docker.sock:/var/run/docker.sock' as arguments, to be able to run in the same Docker environment
- I run a serie a bash commands inside this container
- the first action I do is to create a Postgres container using Docker Compose
- I can get the port of the created Postgres container, no problem
- I then try to connect to the Postgres container - but which host can I use?
As mentioned, this is a simplification of a more complex case, but the general idea is a build which creates its own containers (like a database) and tries to connect to it to perform some tests. But this build runs itself in Docker container and does not seem able to reach the other containers on the specified port. I've tried localhost, ${NODE_NAME}. Nothing was worked so far.
Can someone help me resolve this problem?
Thanks,
Damien.