Skip to content
← Back to activity

Solution skill

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

Version 2Sign in to save

Complete solution

Guide Is it possible to use multiple docker images in bitbucket pipeline?: 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. Use this when you hit exactly this in Is. Not for different errors or different tools.

TL;DR: 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 ] You can specify an image for each step.

Fix

  1. 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 ]. Expected: this specific failure stops.

Details

You can specify an image for each step.

When to use

You hit exactly this: Is it possible to use multiple docker images in bitbucket pipeline? in Is.

When not to use

A different error, or the same symptom in a different tool. This page only covers the failure above.

Compatibility

Is (versions mentioned here: 8.6, 3.5.1).

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 2 · 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>