The following procedure applies to version 1.5 and later of Docker.
To enable users other than root and users with sudo access to be able to run Docker commands:
Create the docker group:
# groupadd dockerRestart the docker service:
# service docker restartThe UNIX socket /var/run/docker.sock is now readable and writable by members of the docker group.
Add the users that should have Docker access to the docker group:
# usermod -a -G docker testuser
Now logout the user account and login back (or) exit from the terminal and login back
Note:
- Users who can run Docker commands have effective root control of the system. Only grant this privilege to trusted users.
- Add sudo as a prefix to the above commands, when executing them through non root user who has sudo privilege
0 Comments