This is sample build docker swarm cluster over TLS using Terraform on DigitalOcean.
Refs: TLS認証なDocker Swarmクラスタを構築 (docker-machineなしで)
cp terraform.tfvars.sample terraform.tfvars
vi terraform.tfvars
terraform plan
terraform apply
it output tls keys to keys
directory.
docker --tlsverify \
--tlscacert=keys/ca.pem \
--tlscert=keys/cert.pem \
--tlskey=keys/key.pem \
-H=(ipv4_address of first host):3376 \
info
or
export DOCKER_TLS_VERIFY="1"
export DOCKER_CERT_PATH="/path/to/keys"
export DOCKER_HOST="(ipv4_address of first host):3376"
docker info