Forums

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

In Pipelines, Is it possible to use the same image for multiple steps ?

Deleted user September 11, 2018

Hey all, 

 

I have a repo that has a number of steps and the process is quick but before every step is pulls a new image even though it is the same. Is there a way I can pull the image once and run all steps/deploymets using the same image ? 

 

Thanks

1 answer

1 vote
Gabriele Franck
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 13, 2018

Hey @[deleted]

According to our documentation each step runs it’s own separate Docker container, which means that they must run in a different context for each step.

You can define a global image for your build, which will use the same image for your whole build, like this for example:

image: openjdk        #this image will be used by all steps unless overridden 
   
pipelines:
  default:
    - step:
          script:
        - npm install
        - npm test
    - step:      
        - npm install
        - npm test

Let me know if this helps!

Gabi

Deleted user October 11, 2018

Hey Gabi

 

Thanks for your reply. I am using a global image already.

 

However, the biggest problem I have is that every single step will pull and clone a new image, even though is the same as the step before, and that slow down my release significantly.

 

I would love if I could pull/clone the image once and run multiple steps. 

 

Any suggestions ?

 

Thanks,

Luiz

Deleted user October 11, 2018
Gabriele Franck
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 12, 2018

Hey, @[deleted]

As you can see in our Configure bitbucket-pipelines.yml doc, 'each step starts a new Docker container that includes a clone of your repository, and then runs the contents of your script section inside it. '

Which means that you can't use multiple steps here :( 

Abdalla Tayfour
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 9, 2019

:(

vitaliy-ryaboy
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 28, 2020

there are no updates for this feature?

Daniel González Jiménez
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 12, 2020

Make sense if this can be an option as there would be many steps that can be removed between steps and be reused for a specific pipeline.

Like serhatakbak likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events