Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing .docker folder on Ubuntu

Tags:

docker

ubuntu

I followed the official guide and installed docker-ce on Ubuntu 18.04 x64.

Per the instructions on Manage Docker as a non-root user, I tried to modify the ownership of .docker folder, and got a "No such file or directory" error:

$ sudo chown "$USER":"$USER" /home/"$USER"/.docker -R
chown: cannot access '/home/eric/.docker': No such file or directory

In fact, I don't even have a .docker folder:

$ ls ~/.docker
ls: cannot access '/home/eric/.docker': No such file or directory

In an earlier step, I was able to run the hello-world container successfully:

$ sudo docker run hello-world
Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/

For more examples and ideas, visit:
https://docs.docker.com/get-started/

What did I do wrong?

like image 390
Eric L Avatar asked Jun 13 '26 07:06

Eric L


1 Answers

Having the same problem. It finally worked for me after I restarted my laptop (which is running Ubuntu 18.04). Logging out and back in wasn't enough.

Manually created the .docker folder using mkdir .docker before restarting though.

like image 170
YeeHaw1234 Avatar answered Jun 16 '26 07:06

YeeHaw1234



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!