Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

Bitbucket pipeline - Docker connection refused

Stripping out the details I have a make file which looks as follows to run some form of integration tests.

 

test-e2e:
docker-compose -f ${DOCKER_COMPOSE_FILE} up -d ${APP_NAME}
godog
docker-compose -f ${DOCKER_COMPOSE_FILE} down

Docker compose is a single webserver with ports exposed.

 

Pipeline looks as follows:

 - step: &integration-testing 
name: Run integration tests script: # do this to make go module work with private repo
-
apk add libc-dev py-pip python-dev libffi-dev openssl-dev gcc libc-dev make bash
-
pip install docker-compose - git config --global url."git@bitbucket.org:".insteadOf "https://bitbucket.org/"
-
go get github.com/onsi/ginkgo/ginkgo - go get github.com/onsi/gomega/... - go get github.com/DATA-DOG/godog/cmd/godog
-
make build-only && make test-e2e 

 

I am facing two separate issues for both i have not been able to find a solution.

1. Keep getting connection refused when the tests are run.

To elaborate above, the docker compose brings up a server with proper host:port mapping ("127.0.0.1:10077:10077"). The command godog is intended to run the tests by querying the server. This however always ends in connection refused.This link  has a possible solution , so i am exploring that.

 

2. The pipeline almost always runs commands before the container is up. I've tried fixing this by changing the invoke to.

test-e2e:
docker-compose -f ${DOCKER_COMPOSE_FILE} up -d ${APP_NAME} && sleep 10 && docker exec -i oracle-go godog && docker-compose -f ${DOCKER_COMPOSE_FILE} down

However the container is always brought up after the sleep (almost instantaneously).

Example:

Creating oracle-go ... 
Sleep 10
docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
docker exec -i oracle-go godog
Creating oracle-go ... done
Error response from daemon: Container 7bab5322203756b972e7f0a3c6e5827413279914a68c705221b8af7daadc1149 is not running

 

Please let me know if there is a way around it.

1 answer

0 votes
mkleint Atlassian Team Mar 12, 2020

can both issues be caused by the docker-compose command either not starting up the containers properly or by the containers immediately exiting? You will probably need to examine the container logs (if any) to see what is going on. Another possibility for the port not being accessible is slow startup of the web application. Docker daemon logs could also be useful here.

You can also try increasing the size of the pipelines build and the amount of memory available to the docker daemon service where your containers are running.

 

Hope that helps

Suggest an answer

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

Calling any interview participants for Bitbucket Data Center

Hi everyone,  We are looking to learn more about development teams’ workflows and pain points, especially around DevOps, integrations, administration, scale, security, and the related challeng...

466 views 4 4
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