Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
badges earned

Your Points Tracker
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

"Could not resolve host: couchdb" in docker-compose

I have a docker-compose.yml that contains a few machines:

  • hat (my python+react app)
  • db (postgresql)
  • couchdb
  • redis

My bitbucket pipelines is:

image: python:3.6
docker: true
- step:
- curl -L`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
- chmod +x /usr/local/bin/docker-compose
- docker-compose build
- PGDATA=./pgdata docker-compose up -d db couchdb redis
- PGDATA=./pgdata docker-compose run hat test_python
- docker
- docker
memory: 2048


PGDATA is overriding the volume path that is usually ../pgdata (forbidden in bitbucket, obviously)

Since hat depends on the others, I only added the docker-compose up to check why it was failing.

When I run these commands locally on my mac, no problem, everything runs smoothly. When I run it in pipelines, the "run hat test_python" starts with a

set -e

# Simple script to wait for DBs to have been started

until psql -h "db" -U "postgres" -c '\l' > /dev/null; do
>&2 echo "Waiting for postgres..."
sleep 1

until curl -s "http://couchdb:5984" > /dev/null; do
>&2 echo "Waiting for couchdb..."
sleep 1

The psql part works fine but the curl thing loops forever. If I remove the -s, I get:

Screen Shot 2019-04-05 at 10.59.21.png

My docker-compose was using links and someone suggested to switch to networks. Didn't change anything.

I don't have a clue what could be making the Bitbucket Pipelines differ from what I have nor how to investigate. Any suggestion ?

1 answer

0 votes

Hi @Eric Darchis

What do you get when you try to run the below command?

curl -s "http://couchdb:5984" > /dev/null

According to the log messages you shared it seems that the curl command is not able to resolve the couchdb host. It curl is not able to translate that name into an IP it will never be able to see if the service is up or not.

Does it make sense to you?

Are you able to run a test with an IP for that, to check if this is the issue?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket Pipelines

Bitbucket Pipelines Runners is now in open beta

We are excited to announce the open beta program for self-hosted runners. Bitbucket Pipelines Runners is available to everyone. Please try it and let us know your feedback. If you have any issue...

758 views 15 10
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you