You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
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)?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.