The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

bitbucket pipelines images definitions

Viktor Ivershin
August 28, 2019

Hello,

 

could anybody give me example of how make docker images definitions.

 

definitions for steps, need same for docker images

 

definitions: 
  steps:
    - step: &build-test
        name: Build and test
        script:
          - mvn package
        artifacts:
          - target/**

pipelines:
  branches:
    develop:
      - step: *build-test
    master:
      - step: *build-test

 

Thanks

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 29, 2019

Hello @Viktor Ivershin,

I'm not sure this is what you meant: one of the simplest ways of building a Docker image basically consists of two steps:

  • Prepare a Dockerfile. This file explains what should your image contain and where should it get that content from. It also describes how the image will work by default (some parts of the config can be overridden at runtime).
  • Build an image using that file. This command reads the file prepared earlier and builds an image following instructions there. You can use the resulting image to run containers. You can also upload it to the registry so that it could be used on another machines.

I hope I understood your question correctly. Please elaborate the details otherwise.

Cheers,
Daniil

Viktor Ivershin
August 29, 2019

definitions for steps, need same for docker images

 

definitions: 
  steps:
    - step: &build-test
        name: Build and test
        script:
          - mvn package
        artifacts:
          - target/**

pipelines:
  branches:
    develop:
      - step: *build-test
    master:
      - step: *build-test
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 30, 2019

Then these pages are probably what you're after:

They both contain examples on how to use Docker in the configuration.

Cheers,
Daniil

Viktor Ivershin
September 2, 2019

I need example how to use definitions for docker images in pipelines, not docker builds or something

Like Pedro Ramos likes this
Pedro Ramos
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!
March 15, 2022

definitions:

  image: &name-of-definition

    {{image configuration}}

...

 

branch:

  master:

    - step

        image:

          <<: *name-of-definition

TAGS
AUG Leaders

Atlassian Community Events