Why does adding user to docker user group allows docker to be run as non root? -


docker needs root permissions run. this guide gives instructions managing docker non-root user, adds user docker user group after i'm able run docker commands sudo. can explain why work?

you have distinguish between docker command line tool docker , background daemon dockerd. daemon runs root , responsible running containers. command line tool docker gives daemon instructions, do. communication done via unix socket /var/run/docker.sock default. ls -l yields

srw-rw---- 1 root docker 0 aug 20 11:22 /var/run/docker.sock 

you can see user belongs group docker able write socket , able give daemon instructions can executed root permission.

you can configure daemon listen on network port instead. can tell command line tool use remote docker daemon via environment variable docker_host. doing can give instructions docker daemons on remote hosts.


there point 1 should mention. when add user group using sudo, , execute other commands sudo, sudo not prompt again password, because cache time.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -