Using Docker as non-root

Normally you need to run docker as root:
$ sudo docker run hello-world
If this is going on your nerves, you can add your normal user to the docker-usergroup.
But before you do this, read the warning in this Post (where i also got the code from)

$ sudo groupadd docker
$ sudo gpasswd -a $USER docker

logout / logout from your computer and run:
$ docker run hello-world
Should work now!

If you got something like config.json – Permission denied
$ docker run hello-world
WARNING: Error loading config file: /home/joergi/.docker/config.json - stat /home/joergi/.docker/config.json: permission denied

This can be fixed by typing in this (from this post)
$ sudo chown "$USER":"$USER" /home/"$USER"/.docker -R
$ sudo chmod g+rwx "/home/$USER/.docker" -R

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s