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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,459,458
Community Members
 
Community Events
176
Community Groups

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.

2 answers

Having this exact problem. Did you find a solution for it?

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

Atlassian Community Events