pyinfra-dev / pyinfra

pyinfra turns Python code into shell commands and runs them on your servers. Execute ad-hoc commands and write declarative operations. Target SSH servers, local machine and Docker containers. Fast and scales from one server to thousands.
https://pyinfra.com
MIT License
3.85k stars 374 forks source link

Allowing docker user to be specified #661

Open themanifold opened 2 years ago

themanifold commented 2 years ago

Allow the docker user to be specified when building a docker image. At the moment, we can already specify the ssh user (--user, --ssh-user) and winrm user (--winrm-username), so it would make sense to have a --docker-user or something similar that will allow us to build an image using a specific user that is not root. This of course is dependent on that user being available in the image.

mvgijssel commented 1 year ago

I've just setup a development environment which uses a docker container to test of the Pyinfra deploy is still working (https://github.com/mvgijssel/setup/pull/212). Being able to specify the user would make this setup closer resemble production and would surface if, for example, a _sudo=True is missing.