Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Services image name as variable

Mohan Kona September 25, 2024

I have different images based on environment, hence i want to use custom image in services, but implementation of any of the below throws error.

definitions: 
services:
frontend
:
image:
name: $docker_image

 OR

 

services:
- $docker_image

2 answers

2 accepted

1 vote
Answer accepted
Syahrul
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 26, 2024

G'day, @Mohan Kona 

Currently Bitbucket Pipelines doesn't support the usage of variables for step attributes, such as defining the image name. We do have a close feature request on this issue at:

Essentially, this feature request was close due to a new feature request release Dynamic pipelineOne of the MANY things Dynamic Pipelines solves is the ability to specific Docker image names via variables in Pipelines. Please check the documentation for more information:

https://support.atlassian.com/bitbucket-cloud/docs/dynamic-pipelines/

Regards,
Syahrul

Caterina Curti
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 30, 2024

Hi,

I've just published an article and a video showing how you can use a variable as the image name.

This solution is based on Dynamic Pipelines and requires a Forge app.

The article shows how to replace an "IMAGE_TAG" value (image: node:$IMAGE_TAG) but would work with no changes when the variable contains the full name of the image.

 

Hope this helps,
Caterina

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events