48

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?

82

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.

  • 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
  • 1
    Hi. I moved away the file and everything seems to work fine now. – Trm Mar 20 '16 at 0:44
  • 1
    Cool @Trm I wonder if you maybe needed to do chown -R USER:DOCKER /home/USER/.docker ? – Grammargeek Mar 20 '16 at 14:57
  • 1
    For the lazy: sudo chown $(whoami):docker /home/$(whoami)/.docker/config.json just copy paste. – SWiggels Jun 8 '17 at 9:07

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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