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
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
This is my script when this script is triggered in bitbucket-pipeline.yml i received error that you cannot run pod as root user
basically -pod install command does not work
this is my gem file in xcode project for iOS
gem "cocoapods", "1.12.1"
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
Bitbucket pipline error screen shot
name: Build and Test
- bundle install
- pod install
Hi Sami and welcome to the community!
The error in the output of the command says that you cannot run CocoaPods as root.
Just to give you some context, Bitbucket Pipelines builds run in Docker containers. For every step of the pipeline, a Docker container starts (the build container) using the image you have specified in your bitbucket-pipelines.yml file. The repo is cloned in that container and then the commands of that step's script are executed. When the step is finished, the container gets destroyed.
The default user in many containers is root. I see in the screenshot you posted that the option --allow-root is available for the pod install command. One option would be to try running the command with --allow-root.
Alternatively, you can run a Pipelines step as a different user by specifying the run-as-user option:
As mentioned in the documentation, the specified user UID needs to be a user already defined in the Docker image (in your case the DockerHub image ruby:2.6) and should have a valid home directory.
If you have Docker installed on your computer, you can start locally a Docker container based on ruby:2.6 with the command
docker run -it --entrypoint=/bin/bash ruby:2.6
Inside the container, you can run the command cat /etc/passwd to see the image's users and their UID.
You can then run this specific Pipelines step as a different user.
Please feel free to reach out if you have any questions!
Pipelines builds run on a Kubernetes cluster of Linux Docker hosts. If your build needs to run on MacOS hardware, then, yes, you can use a MacOS self-hosted runner.
This is the documentation for runners:
And the page for MacOS Runners: