新版本的docker for Mac去除了docker-machine指令
我现在怎么获取 rest api 开发的端口呢?
比如:
curl -XGET http://localhost:2376/images/... | python -mjson.tool
可是,貌似不是上面的2376端口。
谢谢指教。
新版本的docker for Mac去除了docker-machine指令
我现在怎么获取 rest api 开发的端口呢?
比如:
curl -XGET http://localhost:2376/images/... | python -mjson.tool
可是,貌似不是上面的2376端口。
谢谢指教。
这里的端口取决于你docker daemon绑定的端口。
如果daemon运行时没有指定端口,默认用unix:///var/run/docker.sock
By default the Docker daemon listens on unix:///var/run/docker.sock and the client must have root access to interact with the daemon. If a group named docker exists on your system, docker applies ownership of the socket to the group.
https://docs.docker.com/engin...
例如运行时:
docker -d -H unix:///var/run/docker.sock -H 0.0.0.0:2376
相当于将默认的socket绑定在本机的2376,也就是你说的http://localhost:2376
3 回答5.3k 阅读✓ 已解决
3 回答2k 阅读✓ 已解决
3 回答1.5k 阅读✓ 已解决
3 回答1.9k 阅读✓ 已解决
2 回答2.5k 阅读✓ 已解决
4 回答1.8k 阅读✓ 已解决
4 回答1.3k 阅读✓ 已解决
我这里通过一种折中的办法
环境:MacOS
在shell里敲入:vim ~/.bash_profile ,在文件的末尾键入下面代码
保存退出,重启shell。

然后就可以使用dest指令实现一些功能,如罗列images:
dest /images/json