Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker non-root access: Error loading config file:stat /home/wu/.docker/config.json

Tags:

docker

I finished the docker installation with non-root access, namely

1.define a docker user group
2.add my current user to the docker group

pass the test

docker run --rm hello-world

but when I start to provision my docker containers, somewhere in the procedure I got the error:

Error loading config file:stat /home/user/.docker/config.json:Permission Denied

seems to be docker is trying to access some resources but got denied

What is happening here? How could I fix this ?

thx

like image 995
Hello lad Avatar asked Sep 21 '15 14:09

Hello lad


2 Answers

It may be that the .docker folder and the .docker/json.config file is not owned by the current user.

Try this:

sudo chown $USER:docker ~/.docker
sudo chown $USER:docker ~/.docker/config.json
sudo chmod g+rw ~/.docker/config.json
like image 96
G. Rafael Avatar answered Nov 12 '22 17:11

G. Rafael


I've got the same error after upgrate from 1.4 to latest. Fix: manually create .docker/config.json ( put empty json object there {} ) and set ownership like this :

-rw-r--r-- 1 myuser docker /home/myuser/.docker/config.json
like image 2
user1918462 Avatar answered Nov 12 '22 16:11

user1918462