Forums

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

How to use a custom image on a self hosted runner as the pipeline Image

Anthony Bou Eid
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 17, 2023

Hello,

This is the scenario I have. 
I'm using a linux machine as a self hosted agent. On this agent I have a custom Image that has all my requirements.
Is there a way to specify in the bitbucket-pipeline.yml file to use this image?

For example in github I would do:

runs-on: self-hosted-linux # self hosted agent tag
container: my-custom-image:latest

Container here specifies the image that already exists on self-hosted-linux and tells the pipeline to create a container from that image and use it as an image for the pipeline. 

Is there an equivalent in Bitbucket?
Thanks!

1 answer

0 votes
Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 19, 2023

Hey Anthony,

Custom docker images used in your build environment are only compatible with Linux Docker runners, it is not supported within Linux Shell environments.

Here is some documentation to assist you further:

Cheers!

- Ben (Bitbucket Cloud Support)

Anthony Bou Eid
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 20, 2023

I tried the approach foudn in the 2nd link:

definitions:
  services:
    docker-custom:
      type: docker
      image: private-image (this is the image that is on the self-hosted linux machine)

pipelines:
  default:
      - step:
          name: test
          runs-on:
            - 'self.hosted'
            - 'linux'
          services:
            - docker-custom
          script:
            - python3 main.py

This throws an error saying that I have to authenticate with my Azure Container Registry to use the image... It doesn't use the image that is found on the machine



Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 21, 2023

Hi Anthony,

 

Can you try reference the image like this if it is hosted locally?

 name: localhost:0000/imagename

Where 0000 is the port number and imagename is the name of the image.

Cheers!

- Ben (Bitbucket Cloud Support)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events