Ubuntu上缺少.docker文件夹

时间:2018-09-25 02:47:02

标签: docker ubuntu

我遵循official guide,并在Ubuntu 18.04 x64上安装了docker-ce

按照Manage Docker as a non-root user上的说明,我尝试修改.docker文件夹的所有权,并收到“无此文件或目录”错误:

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

实际上,我什至没有.docker文件夹:

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

在先前的步骤中,我能够成功运行hello-world容器:

$ 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/

我做错了什么?

2 个答案:

答案 0 :(得分:3)

当您成功通过Docker注册表进行身份验证(例如,运行命令.docker的{​​{3}}时,将创建目录.docker/config.json(和文件docker login)。

(前提是$USER是组docker的一部分。)

答案 1 :(得分:1)

有同样的问题。重新启动笔记本电脑(运行Ubuntu 18.04)后,它终于对我有用。注销并重新登录还不够。

在重新启动之前,先使用<ul class="nav nav-tabs hero-image-tabs"> <li class="hero-img-1"><a href="#" data-toggle="tab" data-bg="img/bg-img-hero-2.jpg">Hero 1</a></li> <li class="hero-img-2"><a href="#" data-toggle="tab" data-bg="img/bg-img-hero-8.jpg">Hero 2</a></li> </ul> <header class="hero-section py-5 "> <div class="container py-5"> <div class="row"> <div class="col-md-12"> <h1 class="display-4 text-white mt-4">Connecting Leaders. Inspiring Innovation.</h1> </div> </div> </div> </header> 手动创建.docker文件夹。