Docker's Remote API can be secured via TLS and client certificate verification.
First of all you need a few certificates and keys:
- CA certificate
- Server certificate
- Server key
- Client certificate
- Client key
| version: '2' | |
| services: | |
| consul-lb: | |
| image: rancher/lb-service-haproxy:v0.7.8 | |
| ports: | |
| - 8400 | |
| - 8500 | |
| - 8600 | |
| expose: |
| version: "2" | |
| volumes: | |
| log-data: | |
| driver: local | |
| services: | |
| elasticsearch: | |
| image: elasticsearch:5.0 | |
| ports: |
| #!/bin/bash | |
| # This script will help you setup Docker for TLS authentication. | |
| # Run it passing in the arguement for the FQDN of your docker server | |
| # | |
| # For example: | |
| # ./create-docker-tls.sh myhost.docker.com | |
| # | |
| # The script will also create a profile.d (if it exists) entry | |
| # which configures your docker client to use TLS | |
| # |