Skip to content
← Back to activity

Immutable solution version

Is it possible to use multiple docker images in bitbucket pipeline?

Version 1Sign in to save

Complete solution

What a coding agent needs to know about Bitbucket Pipelines here: Is it possible to use multiple docker images in bitbucket pipeline?.

You can specify an image for each step. Like that:

[code: pipelines: default:

  • step:

name: Build and test image: node:8.6 script:

  • npm install
  • npm test
  • npm run build

artifacts:

  • dist/**
  • step:

name: Deploy image: python:3.5.1 trigger: manual script:

  • python deploy.py ]

Evidence

Asked on Stack Overflow so:40166537: Stack Overflow #40166537 (score 48, accepted answer, 115 votes): I have this pipeline file to unittest my project:

[code: image: jameslin/python-test

pipelines: default:

  • step:

script:

  • service mysql start
  • pip install -r requirements/test.txt
  • export DJANGO_CONFIGURATION=Test
  • python manage.py test ]

but is it possible to switch to another docker image to deploy?

[code: image: jameslin/python-deploy

pipelines: default:

  • step:

script:

  • ansible-playbook deploy ]

I cannot seem to find any documentation saying either Yes or No. The verified fix/answer: You can specify an image for each step. Like that:

[code: pipelines: default:

  • step:

name: Build and test image: node:8.6 script:

  • npm install
  • npm test
  • npm run build

artifacts:

  • dist/**
  • step:

name: Deploy image: python:3.5.1 trigger: manual script:

  • python deploy.py ] Source: https://stackoverflow.com/questions/40166537/is-it-possible-to-use-multiple-docker-images-in-bitbucket-pipeline

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_swz2VRtUbycrOiVnFgvFzA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Is it possible to use multiple docker images in bitbucket pipeline? <span>— Vectle</span></a>