I am testing something in docker, it requires sudo without entering password, I added required entries in /etc/sudoers. After that in host it doesn’t ask for password. But in case of docker it still ask for password. BTW, I am running fedora 24 as VirtualBox VM inside Fedora 24 host.
OS type : Fedora 24 (uname -r : 4.11.12-100.fc24.x86_64 )
Docker version :
abc@webster $ docker version
Client:
Version: 17.06.0-ce
API version: 1.30
Go version: go1.8.3
Git commit: 02c1d87
Built: Fri Jun 23 21:23:42 2017
OS/Arch: linux/amd64
Server:
Version: 17.06.0-ce
API version: 1.30 (minimum version 1.12)
Go version: go1.8.3
Git commit: 02c1d87
Built: Fri Jun 23 21:25:02 2017
OS/Arch: linux/amd64
Experimental: false
Here is the details…
>
> abc@webster $ sudo bash
>
> root@webster $ cat /etc/sudoers
> ## Sudoers allows particular users to run various commands as
> …
> …
> ## Allow root to run any commands anywhere
> root ALL=(ALL) ALL
>
> ## Allows people in group wheel to run all commands
> %wheel ALL=(ALL) ALL
>
> ## Same thing without a password
> # %wheel ALL=(ALL) NOPASSWD: ALL
>
> %users ALL=(ALL) ALL
> %admin ALL=(ALL) NOPASSWD: ALL
>
> %sudo ALL=(ALL:ALL) ALL
> abc ALL=(ALL) NOPASSWD: ALL
> #abc ALL=(ALL) ALL
>
>
> abc@webster $ id
> uid=1000(abc) gid=1000(abc) groups=1000(abc),10(wheel),100(users),977(docker),1001(admin) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
>
>
> abc@fc-docker $ sudo bash
> [sudo] password for abc: