Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Failed to Build Pipeline: Do not run Composer as root/super user

Mandrizzy
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 15, 2019

Ok so this question as been asked already and I can see the answer however  I'm very new to pipelines and don't have that much info about docker. So here is my yml pipelines configuration file.

 

image: php:7.2-fpm
pipelines:
default:
- step:
caches: - composer
script: - apt-get update && apt-get install -y unzip
-
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
-
composer install
-
./vendor/bin/phpunit

 So the answer simply recommends don't run composer as a root or super user so knowing that how do I using my yml configuration to tell docker not to install composer as a root or super user thank you in advance

1 answer

1 vote
Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 3, 2019

Hi Theodore,

You can override the default user you are running as, to not run as root. 

So instead your configuration could look like:

image: 
name: php:7.2-fpm
run-as-user: 1
pipelines:
default:
- step:
caches:
-
composer
script:
-
apt-get update && apt-get install -y unzip
-
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
-
composer install
-
./vendor/bin/phpunit

More details here.

Note, you may run into some permission errors as you are running as a different user. Feel free to report back with any errors you may get when you enable run-as-user. Hopefully it just works, though!

Thanks,

Phil

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events