mmh352 / ou-container-builder

0 stars 2 forks source link

Allow specifying the user to run scripts under #40

Open mmh352 opened 3 years ago

mmh352 commented 3 years ago

Currently all scripts are run as the root user. For some setup scenarios, for example database initialisation, it would be useful to be able to run a script as a different user.

mmh352 commented 3 years ago

Incorrectly closed.

psychemedia commented 2 years ago

In the scripts block, Docker image layers seem to be built from one or more - commands: lists. If only one scripts block is available, then it would make sense to allow the user to be defined for each commands layer.

This probably requires a schema change in the yml file, or a hack, such as allowing the first line of a - commands list to use some bespoke convention to specify a #!>USER myuser. After the command list, if an explicit user was defined, the dockerfile should then ensure it reverts to the default user for the next layer.