Enabling the Docker daemon socket on a docker host to accept remote connections may be required in certain situations (e.g. automation, centralized management, integration over the Docker API)
Especially in production and when dealing with sensitive data, the TCP connection shall be protected by enabling TLS
This post brings together the minimally required steps to 1. configure the Docker daemon socket for TLS and 2. generate the certificates on a sample basis
Secured remote management
Prerequisites
The setup as described below has been tested on behalf of the following environment:
Docker Host based on CentOS/RHL 7
Docker Engine 1.12.5 (or higher) installed
SSL Certificates
Create the needed SSL server and client certificates (best practice here is to go with certificates being signed by an official certificate authority)
Just for reference and for development usage, here a sample:
Keep in mind that best practice is to generate the private key(s) on the machine where they are required, only having to share the request for signing with your CA of choice
Ensure the needed private key and certificates are being placed securely on the Docker host: