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:
and just under the line that contains something like:
# Use DOCKER_OPTS to modify the daemon startup options. # DOCKER_OPTS="--dns 184.108.40.206 --dns 220.127.116.11"
add in your own entry. For example, if you want to listen on 10.0.0.2, port 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:
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.