is it possible to reflect all the packages installed in runner using your own docker images ?

currently i am using my own docker image in self hosted runner  which contain packages like (sfdx ,volta ,sgd ) .But when i run a bitbucket pipeline it create its own container . do i need to installed all the packages that i installed in runner container again , or the runner packages will reflect in that bitbucket pipeline container ?

2 answers

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 17, 2023

Hi @Adarsha Shrestha ,

If you are using a Linux Docker Runner, then the builds indeed do not run in the runner's container.

For every step of your build, another Docker container starts (the build container) using the image you have specified in your bitbucket-pipelines.yml file. If you use a service for a step, then another Docker container will start for the service which will share a network adapter with your build container. The repo is cloned in the build container, and then the commands of the step's script are executed. When the step finishes, the build container and any service containers get destroyed.

If you want to use certain packages, they need to be pre-installed in the image you specify as a build container in your bitbucket-pipelines.yml file or you can install them during the build. You can always build your own custom Docker image with only the tools you need for your builds, and use that in the yml file. We support public and private Docker images including those hosted on Docker Hub, AWS, GCP, Azure and self-hosted registries accessible on the internet:

Kind regards,
Theodora

0 votes
Erez Maadani
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 16, 2023

Hi @Adarsha Shrestha 

Technically, if you can control the container command, you can add a mount to your installed packages location which should enable you to expose the packages to the container.

Few things that you'll need to consider:

  1. Maintenance & package management overhead.
  2. How will you be able to re-build old versions of your code after some packages have been upgraded? 
  3. Can you keep multiple versions of the same package? How will you support different base images or same base image with different version? 

And there are probably few more things to consider.

Suggest an answer

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

Atlassian Community Events