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
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.