Unfortunately the things that get cloned during a bitbucket pipeline are owned by root. Even if you set the run-as-user directive this is still the case. The only thing that changes when setting this directive is that the cached directories are owned by the defined user.
This is a problem on our use case, because we start a container within this container, where the user is not root. And we share the volume with this container, so we have a permission problem there.
Hi Morgus,
You can add in your yml file a command to change the owner and group of the files in the build container's clone directory.
For example, if you want to change the owner to pipelines user and group to pipelines, you can execute the command:
sudo chown -R pipelines:pipelines /opt/atlassian/pipelines/agent/build
Does this work for you?
Kind regards,
Theodora
This worked thank you. But it doesn't feel like this is good practice. For me it would make more sense, if one could define which user should own the files in the build. Similar to the run-as-user command for the image.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Marcus,
You are very welcome and thank you for the feedback. I can create a feature request for what you are asking, for our development team to consider. Please feel free to let me know if you'd like me to proceed with that.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Marcus,
I went ahead and created a feature request here:
I would suggest adding your vote to that feature request (by selecting the Vote for this issue link) as the number of votes helps the development team and product managers better understand the demand for features. You are more than welcome to leave any feedback, and you can also add yourself as a watcher (by selecting the Start watching this issue link) if you'd like to get notified via email on updates.
Implementation of new features is done as per our policy here and any updates will be posted in the feature request.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.