Skip to content

Instantly share code, notes, and snippets.

@aminelch
Created September 9, 2021 10:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aminelch/00a3a242c22287e7e49cf12bde95f7e2 to your computer and use it in GitHub Desktop.
Save aminelch/00a3a242c22287e7e49cf12bde95f7e2 to your computer and use it in GitHub Desktop.
add docker for no Root user

Post-installation steps for Linux:

#Manage Docker as a non-root user🔗

The Docker daemon binds to a Unix socket instead of a TCP port. By default that Unix socket is owned by the user root and other users can only access it using sudo. The Docker daemon always runs as the root user. $- sudo usermod -aG $USER

To create the docker group and add your user:

Create the docker group.

$- sudo groupadd docker

Add your user to the docker group.

$- sudo usermod -aG docker $USER

Log out and log back in so that your group membership is re-evaluated.

On Linux, you can also run the following command to activate the changes to groups:

$- newgrp docker

verify that you can run $- docker run hell-word

This command downloads a test image and runs it in a container. When the container runs, it prints a message and exits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment