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

Docker-compose and pipelines

Jean-Mark Wright May 30, 2016

This question is in reference to Atlassian Documentation: Use Docker images as build environments in Bitbucket Pipelines

I currently use Docker-Compose and have several Docker containers that I need to properly test. How do I set that up with Pipelines?

11 answers

9 votes
Thomas Fankhauser July 14, 2016

This makes pipelines really useless for us. The container idea is to have one process per container.

Please integrate this with the standardised docker-compose.yml file. No need for a further declaration option.

5 votes
Dan Frankowski June 19, 2019

Three lines I added to the "script" block:

script:
- apt-get update
# Add python pip and bash
- apt-get -y install python3-minimal python3-pip
# Install docker-compose via pip
- pip3 install docker-compose

I was using the python:3.7.3 image, but it would work on a lot of ubuntu-based images I think. 

3 votes
Pejman Ghorbanzade January 16, 2018

As an update, Bitbucket has recently announced additional features for docker pipelines that not only allows multiple container builds but also supports docker-compose.

 

We’re also excited to announce that Pipelines now offers complete hosted Docker support, allowing you to build, run and test your Docker-based services in any configuration that doesn’t require privileged mode on the host. This includes using docker-compose to start a set of microservices up for testing on Pipelines.

Please refer to official documentations for more information.

adiachenko February 11, 2018

There is absolutely no mention in the docs about Docker Compose at the time of this writing.

Also, from what I remember the 2 biggest platforms that actually provide support for it (Travis CI and GitLab), both achieve it via some kind of privileged mode. Even Circle CI requires machine executor. So the blog post itself is pretty much contradictory.

Until I see actual working example with docker-compose command, mounted volumes and the like, this so-called "support" may as well not exist.

Like VictorUsoro likes this
iperdomo March 15, 2018

Hi,

We're using docker-compose in our builds. Here you have an explanation on the process.

 

https://medium.com/magnetcoop/using-docker-compose-in-bitbucket-pipelines-81ead8cf0153

 

Cheers,

Like # people like this
adiachenko March 15, 2018

Thank you very much, Iván Perdomo. This is very useful.

I wish Atlassian documented this properly.

2 votes
Victor Fleurant June 5, 2020
- step: &integration-test
name: Integration Tests
image: docker/compose:latest
services:
- docker
caches:
- docker
script:
- docker-compose -f docker-compose-integration.yml build
- docker-compose -f docker-compose-integration.yml up
2 votes
André Jonas March 13, 2017

Is there any update on Bitbucket Pipelines support for docker-compose?

1 vote
Jean-Mark Wright June 2, 2016

Any advice on how to work without this now? We currently have several images that compose our stack (e.g. web, db, cache)

0 votes
Anton Daneyko December 20, 2020

I get sporadic failures, when I run my docker-compose test.  I have seen it quite a few times, when I run the pipeline for the same commit and sometimes it passes, sometimes it fails.  In my test I use wait-for-it as described in https://docs.docker.com/compose/startup-order/ and probe the service under test before issuing a request.  I have a 15 seconds timeout ATM for booting the service and sometimes I see it failing although in the runs that pass the service is available after 1 second.

0 votes
cahit beyaz April 16, 2020

For recent docker-compose 

Following pipeline file works:


image: docker:stable

options:
docker: true

pipelines:
default:
- step:
script:
- apk add --no-cache py-pip python-dev libffi-dev openssl-dev gcc libc-dev make
- pip install docker-compose
- docker-compose up
- docker-compose down
0 votes
Jacek Furmankiewicz October 15, 2017

Hi any updates from Atlassian on this?

I already had all my tests set up nicely in Docker Compose and then hit this roadblock of Docker Compose not being supported.

The approach of declaring other services and relying is really primitive compared to what Docker Compose offers out of the box.

0 votes
utrecht April 6, 2017

Running docker-compose results in: The Docker Engine version is less than the minimum required by Compose.
Your current project requires a Docker Engine of version 1.13.0 or greater. Does this mean that running docker-compose is still not supported or is this a configuration issue. (http://devops.stackexchange.com/q/795/210)

0 votes
Sten Pittet
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 1, 2016

Hi Jean-Mark,

We do not support yet Docker Compose in Bitbucket Pipelines but this is something that we would like to investigate in the future.

Thanks,

Sten

Igor Leão June 2, 2016

Hi @Sten Pittet,

Is there a way to run multiple containers?
For instance, I have a test suite which depends on Mongo.

Do you know any workaround for running this image with pipelines?

Greg Woods June 2, 2016

I am also interested in this, as our test suite relies on postgres. If the stock image had access to various databases that would mitigate the issue for me. 

Sten Pittet
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 2, 2016

Running multiple containers as part of a pipeline is not available yet but we're looking into some options to provide this capability.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events