Skip to content

Stop using the root user for test/cli containers #416

@acbramley

Description

@acbramley

Locally, when running cli/test containers the user that is used is root. This means when running things like config export, or composer install from inside the container (which is required when your host uses a different PHP version since govcms is currently constrained to PHP 8.1) all files resulting from the commands are owned by root:root this then locks them out from being editable from your host (i.e in an IDE)

This leads to a very frustrating experience where multiple times a day I'm having to chown directories on my host machine just to make changes.

Skpr images for example use a skpr user https://github.com/skpr/image-php/blob/main/cli/Dockerfile#L50

This user uses uid and gid of 1000 to align them with linux users

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions