Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

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 March 15, 2022

definitions:

  image: &name-of-definition

    {{image configuration}}

...

 

branch:

  master:

    - step

        image:

          <<: *name-of-definition

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events