Pipelines - Docker volumes in services definitions

Garry Dias May 8, 2020

I'm defining custom services in my bitbucket-pipelines.yml.

But some of these services must use volumes in order to load an specific application configuration file for functional tests.

I tried this:

...
...
definitions
:
services:
backend-api:
image: atlassian/pipelines-awscli:latest
script:
- eval $(aws ecr get-login --region ${AWS_DEFAULT_REGION} --no-include-email)
- docker run -d -v /opt/atlassian/pipelines/agent/build/cypress/backend-api-config:/config 123456.dkr.ecr.us-east-1.amazonaws.com/backend-api:latest
mongo:
image: mongo

 is it possible? Or should I use docker-compose solution?

1 answer

0 votes
Max Binnewies
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 14, 2020

Hi Garry,

you can not have a script section as part of a service definition in Pipelines.

You could bake the commands you want to run into a custom docker image that you want to run as a service or simply run your docker run command as part of a step where you want to use it. To do that make sure to define "docker" as a service for that step.

Max

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events