Docker: Sudo not installed in docker container

Created on 19 Mar 2020  路  2Comments  路  Source: nextcloud/docker

In order to run occ one needs sudo -u www-data occ, as recommended by the script itself.
However, sudo is not installed in the docker container.
To install sudo, one first must apt update && apt install sudo.

Are there any considerations to having sudo pre-installed, or not pre-installed in the container?

Most helpful comment

as workaround, you don't need sudo, You can run on host this command:

docker exec -u <user> -it <container> bash

then you will be in shell with selected user

All 2 comments

as workaround, you don't need sudo, You can run on host this command:

docker exec -u <user> -it <container> bash

then you will be in shell with selected user

That does indeed work, even with the user's shell being disabled! Thank you for that pointer :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mahnunchik picture mahnunchik  路  3Comments

waldner picture waldner  路  3Comments

DrMurx picture DrMurx  路  4Comments

all-the-good-ones-are-gone picture all-the-good-ones-are-gone  路  3Comments

vancky picture vancky  路  3Comments