Scripts should be executed as user
Closed this issue · 3 comments
Currently, all build steps are executed as user "root", whereas TravisCI uses a dedicated "travis" user. Also, TravisCI supports using sudo
to switch to the root user, JoliCI does not.
This makes it quite difficult to explicitly execute build steps as user "root" (like installing software packages etc.). This can be worked around in the .travis.yml
file, however it's quite cumbersome.
Sample .travis.yml
to reproduce:
language: php
php:
- 5.5
install:
- true # needed until PR #39 lands
script:
- id -un
- sudo id -un
Expected output (also supported by TravisCI):
travis
root
Actual output:
root
<< Exception trace >>
Possible solution: In order to support this, the Dockerfile
s will likely need to be updated to set up a new "travis" (or similar) user and use the USER
instruction before executing any of the build steps.
I agree, we also need to add the sudo config, in order to execute sudo without password.
All this need to be done in the docker-images repository (github.com/jolicode/docker-images), if you want to make a PR for it, otherwise i will do it but not my main concern right now :)
Corrected in the images and the library, thanks for the report