memo.xight.org

日々のメモ

Docker for Mac を Remote APIから使う

Docker server側 で docker-proxyを起動

$ docker run -p 3375:2375 --name docker-proxy -v /var/run/docker.sock:/var/run/docker.sock -d -e PORT=2375 shipyard/docker-proxy


Docker client側 で 環境変数を設定

環境変数 DOCKER_HOST にdocker serverのIPアドレス:ポート番号を指定

$ export DOCKER_HOST="tcp://192.168.0.254:3375"
$ docker ps
CONTAINER ID        IMAGE                   COMMAND                CREATED             STATUS              PORTS                    NAMES
0123456789ab        shipyard/docker-proxy   "/usr/local/bin/run"   2 minutes ago       Up 2 minutes        0.0.0.0:3375->2375/tcp   docker-proxy


Reference

Docker Community Forums - 2016-06-16 - Remote API with Docker for Mac (BETA)
https://forums.docker.com/t/remote-api-with-docker-for-mac-beta/15639/5