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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,455,519
Community Members
 
Community Events
175
Community Groups

How to include files on service containers

I have a seed script that I want to run on a mongo service container for use in my repo's Pipelines. The mongo image can automatically run scripts if provided in a special folder. Is there a way to provide this from my repo code or do I need to create and publish a docker image that includes the seed script(s)?

1 answer

0 votes
Ben Atlassian Team Dec 13, 2022

Hi Ben,

Yes, you are able to provide the scripts in the repository source, as when you perform a build - it will clone the Bitbucket repository as your working directory. This then allows you to navigate to this folder and execute scripts.

You could also create a docker image, however, you would need to push changes to the docker image whenever changes to the scripts are made vs simply committing these changes into the repository.

Cheers!

- Ben (Bitbucket Cloud Support)

Hi Ben,

I can access the repository files from the script section of a pipeline step. But how can I mount a folder or a file in my repository as a volume on a service container?

Thomas

Hey Ben,

Unfortunately, you are unable to mount volumes in Docker aside from the Bitbucket clone directory as this command has been restricted for security reasons due to requiring root privileges (see: Running docker commands heading)

https://support.atlassian.com/bitbucket-cloud/docs/run-docker-commands-in-bitbucket-pipelines/

Another user has raised a request to remove this restriction, you can "Watch" this feature request to receive updates related to it and "Vote" for it to increase its visibility in regard to customer demand:

https://jira.atlassian.com/browse/BCLOUD-22331

I have found this community post suggesting solutions for mapping the clone directory below:
https://community.atlassian.com/t5/Bitbucket-questions/Bitbucket-pipelines-does-Docker-volume-mounting-work-yet/qaq-p/703455

 

Cheers!

- Ben (Bitbucket Cloud Support)

Suggest an answer

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

Atlassian Community Events