新版本的docker for Mac去除了docker-machine指令我現在怎么獲取 rest api 開發的端口呢?比如:curl -XGET http://localhost:2376/images/... | python -mjson.tool可是,貌似不是上面的2376端口。謝謝指教。
2 回答

holdtom
TA貢獻1805條經驗 獲得超10個贊
我這里通過一種折中的辦法
環境:MacOS
在shell里敲入:vim ~/.bash_profile ,在文件的末尾鍵入下面代碼
alias dest='rest_fun(){ curl --unix-socket /var/run/docker.sock http:$1 | python -mjson.tool ;};rest_fun $1'
保存退出,重啟shell。
然后就可以使用dest指令實現一些功能,如羅列images:
dest /images/json
- 2 回答
- 0 關注
- 1217 瀏覽