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
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
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.