How to execute docker commands using non-root users


Posted by Munish Mehta on Tuesday, January 9, 2018
This article will show you how to execute docker commands using non-root users
docker-as-non-root-user

Add the docker group if it doesn’t already exist:

sudo groupadd docker

Add the connected user “$USER” to the docker group. Change the user name to match your preferred user if you do not want to use your current user:

sudo gpasswd -a $USER docker

Either do a newgrp docker or log out/in to activate the changes to groups.


Work Behind The Writing

This article comes from real-world AI and DevOps engineering work.

If the thinking here is useful, explore the projects behind it or get in touch about a similar technical problem.
comments powered by Disqus