$ gitlab-ci-local test_docker_user
parsing and downloads finished in 54 ms
test_docker_user starting ubuntu:latest (test)
test_docker_user copied to docker volumes in 2.34 s
test_docker_user $ whoami
test_docker_user > root
test_docker_user finished in 5.41 s
PASS test_docker_user
And just to confirm via docker CLI:
$ docker run --rm -it --user nobody ubuntu whoami
nobody
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
I have tried updating script to switch users mid-job, but this is a workaround.
Additional context
Add any other context or screenshots about the feature request here.
Is your feature request related to a problem? Please describe. GitLab CI supports specifying the docker user to run the docker-executor as: https://docs.gitlab.com/ee/ci/yaml/#imagedocker
Describe the solution you'd like
gitlab-ci-local
to support the same thing, if possible.For example, running this CI job will always print
root
:And just to confirm via docker CLI:
Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered. I have tried updating
script
to switch users mid-job, but this is a workaround.Additional context Add any other context or screenshots about the feature request here.