使Docker for mac在tcp端口上侦听 [英] Make Docker for mac listen on a tcp port
问题描述
我试图找到docker-java( https://github.com/docker- java / docker-java )使用Docker for mac( https:// docs .docker.com /搬运工换MAC / )。
I'm trying to get docker-java (https://github.com/docker-java/docker-java) to work with Docker for mac (https://docs.docker.com/docker-for-mac/).
如何设置相当于:
DOCKER_OPTS = - H tcp ://127.0.0.1:2375 -H unix:///var/run/docker.sock
在mac版本的Docker?
On the mac version of Docker?
推荐答案
根据 issue 25064 :
〜/ Library / Containers / com.docker.docker / Data / database / com.docker.driver.amd64-linux
是一个git数据库。
~/Library/Containers/com.docker.docker/Data/database/com.docker.driver.amd64-linux
is a git database.
注意:如果〜/ Library / Containers / com.docker.docker / Data / database / code>不包含
com.docker.driver.amd64-linux
,转到数据库/
文件夹,并执行 git reset --hard
。
Note: if ~/Library/Containers/com.docker.docker/Data/database/
does not contain com.docker.driver.amd64-linux
, go to that database/
folder, and do a git reset --hard
.
守护程序配置在
etc / docker / daemon.json
,它只是使用 Linux配置文件。
您需要更改配置,然后执行 git commit
:docker应该在那个时候自动重新启动(如果没有,请重新启动它)。
You need to change the config and then do a git commit
: docker should restart automatically at that point (if not, restart it) with the new configuration.
如 OP Michael Nelson 在评论,并在 Docker中详细说明对于Windows (其中有与Docker for Mac相关的部分)
As mentioned by the OP Michael Nelson in the comments, and detailed in "Docker for Windows" (which has sections relevant for "Docker for Mac")
Docker init
脚本依赖于 / usr / bin / mobyconfig
脚本。
这个 mobyconfig
脚本需要内核以 com.docker.database
标签指定配置文件的位置或它的bails。
The Docker init
script relies on a /usr/bin/mobyconfig
script.
This mobyconfig
script requires the kernel to boot with a com.docker.database
label specifying the location of the config file or it bails.
mobyconfig
脚本能够检索 network
insecure-registry
配置Docker守护程序,或者从 /etc/docker/daemon.json
中获取配置文件。
The mobyconfig
script is able to retrieve network
and insecure-registry
configuration for the Docker daemon or pick up a config file from /etc/docker/daemon.json
.
这篇关于使Docker for mac在tcp端口上侦听的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!