Answer the question
In order to leave comments, you need to log in
How to run containers as different users in Docker?
Is it possible to run Docker containers as other users than just the user who installed Docker.
After adding a new user to the Docker group, I sudo usermod -aG docker qwerty
tried running the container on its behalf: docker run --name test --user qwerty
I got an error:
docker: Error response from daemon: linux spec user: unable to find user qwerty: no matching entries in passwd file.
Answer the question
In order to leave comments, you need to log in
The usual solution:
Bad practice:
if (!in_array(trim(@$_GET['lang']), $config['langs'])) {
Use default value if 'lang' is not passed in GET string
(!in_array(trim($_GET['lang'] ?? null), $config['langs'])) {
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question