75

I just installed docker and created a group and added my username to it to avoid using sudo every time. However when I do the test and run docker run hello-world it gives me following error: WARNING: Error loading config file:/home/user/.docker/config.json - stat /home/user/.docker/config.json: permission denied

But then it continues and gives a success message:Hello from Docker. This message shows that your installation appears to be working correctly. Any ideas whats wrong and what implications does it have?

1
151

Try running

sudo chown "$USER":"$USER" /home/"$USER"/.docker -R
sudo chmod g+rwx "/home/$USER/.docker" -R

$USER is the username of the currently logged in user.

15
  • thanks, that seem to have done it. Just a question, since I changed ownership to my user. Would it be better to change ownership to a group: docker? – Trm Mar 19 '16 at 13:06
  • 1
    was a bit too fast and ran command from earlier root login. I still get the same error. I even tried running: sudo chown user:docker /home/user/.docker/config.json, but it didn't help – Trm Mar 19 '16 at 13:21
  • 2
    Hi. I moved away the file and everything seems to work fine now. – Trm Mar 20 '16 at 0:44
  • 2
    Cool @Trm I wonder if you maybe needed to do chown -R USER:DOCKER /home/USER/.docker ? – Grammargeek Mar 20 '16 at 14:57
  • 3
    For the lazy: sudo chown $(whoami):docker /home/$(whoami)/.docker/config.json just copy paste. – SWiggels Jun 8 '17 at 9:07

Not the answer you're looking for? Browse other questions tagged or ask your own question.