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

How can I install chromedriver within bitbucket-pipelines.yml - Ruby image

Peter Hughes March 20, 2018

I am currently trying to set up a pipeline to build and test a Ruby on Rails project. Which contains specs/tests in rspec/capybara, which are run using headless chrome.

 

In order for this to work, I need to install chromedriver on the docker image, but the preferred way to do this is by using a package manager.

 

However, I am struggling to install the necessary dependencies, i.e npm, or homebrew.

 

I have tried to install Node, with no luck, and similarly with LinuxBrew - i.e on installing brew within the script section

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)"

 

I get the following error:

Don't run this as root!

Can anyone give any advice as the best way to install other packages on a Ruby image?

 

Many Thanks

 

1 answer

1 accepted

0 votes
Answer accepted
Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 28, 2018

Hi Peter,

You can configure your pipeline to run as a user that isn't root. For example:

image:
name: image-name:tag
run-as-user: 1000 # root is always 0. So this will make you non-root.
pipeline:
default:
- step:
script:
- ./do-the-thing

I noticed there seemed to be no reference to this in the documentation, so I've opened an internal ticket to fix that.

Thanks,

Phil

Peter Hughes April 5, 2018

Thank you!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events