简体   繁体   English

从Ubuntu Bash连接到Windows 10 Docker守护程序

[英]Connect to Windows 10 Docker daemon from Ubuntu Bash

I'm trying to do something fairly non-standard, so I'm not sure how successful I'm going to be. 我正在尝试做一些相当不规范的事情,所以我不确定自己会有多成功。

I've installed "Docker for Windows", and I'm able to use it fine from PowerShell. 我已经安装了“Docker for Windows”,我可以在PowerShell中使用它。

I would like to be able to use a proper Linux environment though, so I've installed the new Ubuntu Bash prompt for Windows 10. 我希望能够使用适当的Linux环境,所以我已经为Windows 10安装了新的Ubuntu Bash提示符。

I've successfully built the latest Docker client in Ubuntu/Bash. 我已经在Ubuntu / Bash中成功构建了最新的Docker客户端。 However when I run "docker ps", I get: 但是当我运行“docker ps”时,我得到:

Cannot connect to the Docker daemon. 无法连接到Docker守护程序。 Is the Docker daemon running on this host? Docker守护程序是否在此主机上运行?

I had hoped that it might just work. 我曾希望它可能会起作用。

Is it possible to connect to a Docker daemon running in Windows from Ubuntu/Bash? 是否可以从Ubuntu / Bash连接到Windows中运行的Docker守护程序?

I figured it out. 我想到了。 It was surprisingly simple. 这简直太简单了。 I just had to set the following... 我只需设置以下内容......

export DOCKER_HOST=tcp://127.0.0.1:2375

This is actually a really cool setup. 这实际上是一个非常酷的设置。

A very fast, efficient Docker engine running in a type 2 hypervisor, and a proper Ubuntu-based development environment. 在2型虚拟机管理程序中运行的非常快速,高效的Docker引擎,以及适当的基于Ubuntu的开发环境。 Nice :-) 尼斯:-)

Notice: as @BSalita mentioned in the comment, the Docker service must be running with "Expose daemon on tcp://localhost:2375 without TLS" enabled, which can be found in the general section in Docker Settings (right click on the system tray icon then "Settings..."). 注意:正如注释中提到的@BSalita一样,Docker服务必须在“启用tcp:// localhost:2375而不使用TLS”的“Expose守护程序”上运行,这可以在Docker Settings的常规部分找到(右键单击系统)托盘图标然后“设置...”)。 This option is not checked by default. 默认情况下不会选中此选项。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法连接到 Docker 守护程序 on bash on Ubuntu windows - Cannot connect to the Docker daemon on bash on Ubuntu windows docker:无法连接到 unix:///var/run/docker.sock 上的 Docker 守护进程。 docker 守护进程是否正在运行? Windows 10 上的 Linux Bash Shell - docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? Linux Bash Shell on windows 10 无法连接到 Docker 守护进程 - Windows 10 WSL - Cannot Connect to Docker Daemon - Windows 10 WSL 未安装docker current-Windows 10上ubuntu上的bash - docker current not installed - bash on ubuntu on windows 10 在Windows上使用ssh连接到docker守护程序 - Connect with ssh to docker daemon on Windows 无法连接到 Docker 守护进程 WINDOWS - Unable to connect to Docker daemon WINDOWS 错误:作业失败(系统故障):无法连接到 unix:///var/run/docker.sock 上的 Docker 守护进程。 docker 守护进程是否正在运行? 在 Windows 10 上 - ERROR: Job failed (system failure): Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? on windows 10 如何使用 Docker 工具箱退出在 Windows 10 Home 中启动的 Ubuntu Bash? - How do I exit from an Ubuntu Bash that I started in Windows 10 Home, using Docker toolbox? Windows 10上来自守护程序的Docker Mount Project错误响应 - Docker Mount Project error response from daemon on Windows 10 无法连接到ubuntu上的Docker守护程序 - Couldn't connect to Docker daemon on ubuntu
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM