Linking containers during run




I must be missing something here…
Say I have a container alambic_test which needs access to a postgres container named ‘postgres’. Db requests from alambic_test look for a host named ‘postgres’. It works fine in docker-compose thanks to the container_name command, but I cannot make it work with jet locally since jet names the container differently (and I can find no way to set the container name in the steps or services file).

How do you do guys to connect to other containers during your test runs?

Any idea?




Hey Boris,

if you configure your codeship-services.yml file like the one mentioned on this should work via the jet CLI as well.

If it doesn’t, could you let me know which version of the jet CLI and Docker you’re using, as well as which OS you are running? Sharing a sample services and steps file might help reproduce this as well.


Hi Marko,

Thanks for your quick answer. I followed the tutorial and spent some time doing various tests, of course, but I’m still missing something…

The incriminated build is at

When I run it (alambic_test step) I get the following log (I execute psql to initialise the db in the called script):

2017-02-14T12:19:37.002Zalambic_test_buildpsql: could not connect to server: Connection refused
2017-02-14T12:19:37.002Zalambic_test_build	Is the server running on host "postgres" ( and accepting
2017-02-14T12:19:37.002Zalambic_test_build	TCP/IP connections on port 5432?

I solved this in docker-compose by using the container_name directive, which is not supported by the codeship file.

Please let me know if more information is required. Thanks a lot for any advice/help!



Are you using a script to wait for the database server to get ready? Something like the script mentioned on


I’m sleeping for 10 seconds, which is a bit crude but very efficient. :slight_smile:
I’d like to enphasise however that I don’t think it’s a db-not-really-yet problem; the log explicitly states that the postgres host is not found. Am I misled?




Oh and I realise I didn’t tell you the versions of sw used…
On my local host:

boris@midkemia ~ $ jet version
boris@midkemia ~ $ docker --version
Docker version 1.13.1, build 092cba3



Thanks for the versions, they all look fine.

As for the logs, I didn’t see any reference to the host not being found (at least on, the only error I see is the connection refused, which usually indicates that the server is not ready yet.

You could test by pinging the postgres container though.