首页 \ 问答 \ 使用sudo运行时无法连接到Docker守护进程(Cannot connect to the Docker daemon when running with sudo)

使用sudo运行时无法连接到Docker守护进程(Cannot connect to the Docker daemon when running with sudo)

我的Docker服务已启动并正在运行。 但是,当试图通过使用sudo运行Docker来使用Docker时,例如:

12:40:26/~ $ sudo docker pull fluxcapacitor/pipeline
Using default tag: latest

我有以下错误:

Warning: failed to get default registry endpoint from daemon (Cannot connect to 
the Docker daemon. Is the docker daemon running on this host?). Using system 
default: https://index.docker.io/v1/
Cannot connect to the Docker daemon. Is the docker daemon running on this host?

请注意,我已经在Mac OS X上遵循了这些答案sudo docker无法连接到Docker守护进程。 码头守护程序是否在该主机上运行?

如下:

码头机启动默认

12:40:36/~ $ docker-machine start default
Starting "default"...
Machine "default" is already running.

码头工人

12:41:20/~ $ docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

那么还有什么需要做的呢?

这是:

$ docker --version
Docker version 1.11.2, build b9f10c9

El Capitan

docker-machine env default输出docker-machine env default

$ eval "$(docker-machine env default)"

$ docker-machine env default
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.99.100:2376"
export DOCKER_CERT_PATH="/Users/macuser/.docker/machine/machines/default"
export DOCKER_MACHINE_NAME="default"

My Docker service is up and running. However when attempting to use Docker by running it with sudo, e.g.:

12:40:26/~ $ sudo docker pull fluxcapacitor/pipeline
Using default tag: latest

I have got the following error:

Warning: failed to get default registry endpoint from daemon (Cannot connect to 
the Docker daemon. Is the docker daemon running on this host?). Using system 
default: https://index.docker.io/v1/
Cannot connect to the Docker daemon. Is the docker daemon running on this host?

Note that I had already followed the answers on Mac OS X sudo docker Cannot connect to the Docker daemon. Is the docker daemon running on this host?

as follows:

docker-machine start default

12:40:36/~ $ docker-machine start default
Starting "default"...
Machine "default" is already running.

docker ps

12:41:20/~ $ docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

So what more needs to be done?

This is:

$ docker --version
Docker version 1.11.2, build b9f10c9

on El Capitan.

Output of docker-machine env default

$ eval "$(docker-machine env default)"

$ docker-machine env default
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.99.100:2376"
export DOCKER_CERT_PATH="/Users/macuser/.docker/machine/machines/default"
export DOCKER_MACHINE_NAME="default"

原文:https://stackoverflow.com/questions/37778439
更新时间:2022-02-17 16:02

最满意答案

这是因为服务器上未启用WCF功能。


This was because the WCF features were not all enabled on the server.

相关问答

更多
  • Oleksii的重点在于,如果您在控制台应用程序中托管WCF服务,则会为该用户提供一个Windows会话(用户登录并加载Windows资源管理器),并打开记事本并显示该用户,以便您看到它在UI中。 当您在IIS中托管您的WCF服务时,作为服务器,IIS需要并且不允许用户交互,并且在没有用户登录的情况下也可以工作; 在这种情况下,没有用户界面来托管您的记事本或其他启用了UI的应用程序,您可以执行一个进程来进行细化或其他批处理作业,但不会呈现Windows UI应用程序,因为Windows资源管理器未加载给您, ...
  • 如果您想要使用其他绑定而不是基于HTTP的基于HTTP的绑定,则必须使用WAS,但它仅适用于IIS 7.0+(Win 2008+) If you want to use bindings others than the HTTP-based ones in IIS, you'll have to use WAS but it is available only for IIS 7.0+ (Win 2008+)
  • 您可以在任何EXE中托管WCF服务,而不仅仅是Windows服务。 你必须写一些代码来托管,但它是微不足道的: using System; using System.ServiceModel; using System.ServiceProcess; namespace MyService.Hosts { public partial class MyWindowsService : ServiceBase { ServiceHost host; publ ...
  • 但我注意到WCF服务是无状态的 这种说法有点不对劲。 因为您可以轻松创建启用了状态的“基于WCF”的Web服务。 此外,国家是一个如此广泛的术语,这里不值得报道。 例如,您可以将会话状态与WCF服务一起使用,或者可以将服务的InstanceContextMode属性设置为以下之一: PerCall PerSession 单 当然,这一切都取决于您如何配置服务本身。 如果您的服务需要由不同的客户端使用,则应考虑实施RESTful服务以及OAuth 2.0或类似的服务,您可以使用基本身份验证标头或在成功进行身份 ...
  • 我已经解决了 我希望它会帮助某人。 对配置进行了一些修复(附加)。 允许所有用户,但在较低级别文件夹中过滤。 在操作系统上的IIS上安装缺少的授权处理程序(打开Windows功能...) 使用Visual Studio中的本地IIS而不是IIS Express 如果IIS visrtual文件夹创建失败,请清除用户数据文件夹(C:\ Users \\ Documents \ IISExpress \ config)中的IIS Express配置 为我的azman存储区提供服务应用程序池用户(来自IIS)的读 ...
  • 现在我找到了答案。 它是绑定 ,它规定了这个浏览按钮的行为。 我的解决方案是编辑站点绑定,以便https位于顶部: 同样可以在applicationHost文件中编辑。 Now I've found the answer. It is Bindings that rules the behavior of this Browse button. My solution was to edit site bindings so that https lies at the top: The same can ...
  • 这是因为服务器上未启用WCF功能。 This was because the WCF features were not all enabled on the server.
  • 听起来像.NET 3.0 ISAPI映射消失了。 在.NET 3.0 WCF目录(C:\ Windows \ Microsoft.NET \ Framework \ v3.0 \ Windows Communication Foundation)中运行ServiceModelReg -r Sounds like the .NET 3.0 ISAPI mappings have vanished. In the .NET 3.0 WCF directory (C:\Windows\Microsoft.NET\ ...
  • 检查每个.svc文件的内容。 您是否引用了正确的服务实现? 您需要web.config + .svc文件+ c#合同定义+ c#服务实现才能获得它。 <%@ ServiceHost Language="C#" Debug="true" Service="MyCompany.Services.Merchants.MerchantService" %> Check the content of each .svc file. Are you referencing the corre ...
  • 请求的内容似乎是脚本,静态文件处理程序不会提供。 不要使用Content View,请使用浏览器。 另请参见IIS7.5上的静态文件处理程序不提供的脚本 。 The requested content appears to be script and will not be served by the static file handler. Don't use Content View, use a browser. See also Script not served by static file ha ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)