Ubuntu n00b here. I am tinkering with a Docker container that I created using the following simple Dockerfile:
FROM ubuntu
CMD ["tail","-f","/dev/null"]
Inside the container, as the root user, I try running visudo
and get the following response:
bash: visudo: command not found
I ran ls /etc
and it seems I don't have a sudoers file either.
Is there something special I should have put in my Dockerfile to make these exist?
sudo
in a docker container ? – pLumo Dec 19 '18 at 8:53visudo
is meant to interactively edit thesudoers
file. If you really need to change sudo privs in a container, you only need toCOPY
at container build time asudoers
file that you have prepared outside the container. – xenoid Dec 19 '18 at 9:32