Enhancement | Run Toolbox as host user instead of root
Closed this issue · 1 comments
Describe the Enhancement
Based on this issue, about files created inside the Leverage Toolbox container not being owned by the user running Leverage CLI (aka the host user), the following proposal was raised.
Instead of having an extra step inside the container doing a chown
when finishing the command, the container itself can be run as the host user, thus creating the files owned by it.
E.g.
docker run -it --rm -u ${UID}:${GID} -v $(pwd):/app --workdir /app binbash/leverage-toolbox:1.2.7-0.1.9 version
Plus, this will contribute to security, avoiding the use of root inside the container.
Expected Behavior
The user running inside the container should be the same as used on the host, then all the created files will be owned by it.
Use Case
n/a
Describe Ideal Solution
Run as mentioned before, the container using the host user.
Alternatives Considered
Use a previously configured user (at build time in Dockerfile) and the run a chown.
Additional Context
n/a