我是否尝试连接到没有TLS的TLS启用的守护程序? [英] Am I trying to connect to a TLS-enabled daemon without TLS?

查看:135
本文介绍了我是否尝试连接到没有TLS的TLS启用的守护程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试了解 Docker ,但我一直对隐藏(对我)的错误信息

I'm trying to learn about Docker, but I keep getting cryptic (to me) error messages.

可能最简单的例子是尝试打印我安装的Docker版本:

Possibly the simplest example of this is trying to print the version of Docker I installed:

$ sudo docker version
Client version: 1.4.1
Client API version: 1.16
Go version (client): go1.3.3
Git commit (client): 5bc2ff8
OS/Arch (client): darwin/amd64
FATA[0000] Get http:///var/run/docker.sock/v1.16/version:
    dial unix /var/run/docker.sock: no such file or directory.
    Are you trying to connect to a TLS-enabled daemon without TLS?

我刚刚经历了用户指南,并按照每一步,所以我很惊讶,我收到这个消息...我该怎么办?

I've just been going through the user guide and following every step exactly, so I'm surprised that I get this message... What should I do now?

我只是注意到,如果我不使用 sudo 我没有收到错误:

I just noticed that if I don't use sudo I don't get the error:

$ docker version
Client version: 1.4.1
Client API version: 1.16
Go version (client): go1.3.3
Git commit (client): 5bc2ff8
OS/Arch (client): darwin/amd64
Server version: 1.4.1
Server API version: 1.16
Go version (server): go1.3.3
Git commit (server): 5bc2ff8

当然这个不是一个解决方案,因为我可能需要在路上的某个地方使用 sudo

Of course, this is not a solution as I may need to use sudo somewhere down the road...

我刚刚发现< a href =http://docs.docker.com/articles/basics/ =nofollow noreferrer>另一个页面说如果您使用的是OS X ,那么你不应该使用 sudo 。我不知道他们是否只是为了这个例子,或者是一般的。

I just found another page saying "If you're using OS X then you shouldn't use sudo." I don't know if they mean only for that example, or in general.

推荐答案

对我来说,运行 $(boot2docker shellinit 2> / dev / null)解决问题。

For me, running $(boot2docker shellinit 2> /dev/null) fixed the problem.

这将运行 boot2docker shellinit 命令(三个 set -x ... 行)在当前终端会话中,这让$ code> docker 命令知道在哪里可以找到boot2docker虚拟机。

This runs the output of the boot2docker shellinit command (the three set -x ... lines) in your current terminal session, which lets the docker command know where to find the boot2docker virtual machine.

添加 $(boot2docker shellinit 2> / dev / null )〜/ .bash_profile 文件的底部将确保 docker 命令配置,每次打开您的终端。

Adding $(boot2docker shellinit 2> /dev/null) to the bottom of your ~/.bash_profile file will make sure the docker command is configured, every time you open your terminal.

对于使用Fish shell的人: boot2docker shellinit ^ / dev / null |来源

For people using Fish shell: boot2docker shellinit ^ /dev/null | source.

请注意, 2> / dev / null (和鱼等价物 ^ / dev / null )是可选的。喜欢@ pablo-fernandez建议,这隐藏了写.. 行。

Note that 2> /dev/null (and the Fish equivalent ^ /dev/null) are optional. Like @pablo-fernandez suggested, this hides the Writing .. lines.

这篇关于我是否尝试连接到没有TLS的TLS启用的守护程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆