I've noticed that boot2docker runs docker on a VM as a deamon on port 2375. Then I use local Mac OS X 'docker' command and it executes all calls on VM.
These are the commands I use:
boot2docker start
export DOCKER_HOST=tcp://:2375
And then 'docker images' (for example) is running on VM.
How can I do the same with a physical machine rather then VM?
boot2docker is meant to be for dev purpose. It will spawn a VM. For bare metal, simply install docker on the host and start the docker daemon with docker -d -H tcp://0.0.0.0:4243
.
WARNING: This is very dangerous. Anyone will have root access to your host. In order to secure this, you should change 0.0.0.0
to 127.0.0.1
and either use a SSH tunnel or a nginx/apache frontend with authentification.
On you mac, then just export DOCKER_HOST=tcp://<host ip>:4243