REDtalks #18 – Enabling the docker TCP API in AWS

Not a traditional REDtalks post today (no interview/demo), but this took me a while to work out so I thought I’d share.

What’s this about?

It all started with me building REST extensibility solutions for F5 Networks in AWS. I created (Launched) a new AWS AMI Linux instance – yep, the very first one on the list: “Amazon Linux AMI 2017.03.0 (HVM), SSD Volume Type“.

Next, I followed the AWS instructions to install docker:

sudo yum update -y

sudo yum install -y docker

sudo service docker start

sudo usermod -a -G docker ec2-user

docker info

NOTE: Full docs here:

This is where I got stuck!

As part of the solution I needed to issue a docker command on the docker host, from inside a container… Ok, Batman, to the Google-copter…

There’s loads of suggestions out there to map /var/run/docker.sock into the container using -v. For example:

$ docker run -it -v /var/run/docker.sock:/var/run/docker.sock my_container sh

With this you can execute:

$ curl --unix-socket /var/run/docker.sock http:/containers/json

HOWEVER, there are loads of forum posts saying to be real careful about mapping /var/run/docker.sock to all you containers…

What to do?

Enable the API over TCP! 

Back to the Google-copter, there are a few posts out there about getting it running on Ubuntu but none for the Linux AMI distro…

A solution (hours later…)

1. Change some startup options:

The default ‘OPTIONS’ in /etc/init.d/docker is:


we need to change this to:

OPTIONS="${OPTIONS:-${other_args}} -H tcp:// -H unix:///var/run/docker.sock"

So, you need to go ahead and edit that to something link this:

$ sudo vi /etc/init.d/docker

OPTIONS="${OPTIONS:-${other_args}} -H tcp:// -H unix:///var/run/docker.sock"

2. Restart docker for these options to take effect:

sudo service docker restart

Now you have enabled the docker API over TCP! #w00t

Test the API

Lets get the API version:

curl http://<ip_address>:2375/version

NOTE: Replace <ip_address> with the IP address of the docker host, or its hostname!

The response will look something like this:


Note the:


Now add that version number to the beginning of the URI, slap json on the end of it, and presto:

curl http://<ip_address>:2375/v1.24/images/json




Now you can go read this:


CAUTION: One last step, and this is REALLY important! Don’t leave your Docker API open on the Internet!

REDtalks #17 – Orchestration 2.0 (w/ a side of bacon)

Greeting automators and welcome to edisode #17 of REDtalks. Today’s guest is Tyler Hatton who is from WWTs own internal IT Operations team. Tyler is the F5 BIG-IP Subject Matter Expert for WWT and is hell-bent on replacing the mundane with declarative interfaces and orchestration systems.

Watch this episode to hear about the interesting culture at WWT and their regular hack-a-thon’s. These events themed at breaking the routine and investing internally in continuous education and, my favorite, “continuous improvement”. Following this, Hatton talks us through his brilliantly named, hack-a-thon winning, “(P)orchestrator” solution!

Tune it to understand the time-saving, self-service interface that Tyler produced, quite literally, from the Ops ‘drivers seat’.


Many thanks, Tyler, for sharing your story!