To create the docker group and add your user:
-
Create the
dockergroup.sudo groupadd docker -
Add your user to the
dockergroup.sudo usermod -aG docker $USER -
Log out and log back in so that your group membership is re-evaluated.
If you're running Linux in a virtual machine, it may be necessary to restart the virtual machine for changes to take effect.
You can also run the following command to activate the changes to groups:
newgrp docker -
Verify that you can run
dockercommands withoutsudo.docker run hello-worldThis command downloads a test image and runs it in a container. When the container runs, it prints a message and exits.