Enabling Docker Remote API on Ubuntu

If you need to enable the remote API on an Ubuntu 14.04 based system for Docker, you need to do the following, edit the file located at:

~

If you need to enable the remote API on an Ubuntu 14.04 based system for Docker, you need to do the following, edit the file located at:

/etc/default/docker

and just under the line that contains something like:

# Use DOCKER_OPTS to modify the daemon startup options.
# DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"

add in your own entry. For example, if you want to listen on 10.0.0.2, port 4243:

DOCKER_OPTS="-H tcp://10.0.0.2:4243"

Then restart docker using:

service docker restart

Confirm it’s now running by pointing your browser at http://10.0.0.2:4243/images/search?term=hello which should return some JSON with image names. You’ll need to set the environment variable for the docker CLI command as well, this should work for you:

export DOCKER_HOST=tcp://10.0.0.2:4243

Then restart your shell and it should work as usual.

Tip: If you’re using New Relic to monitor Docker containers, you’ll need this turned on for it to work properly.


~

Comments