bitsofinfo / hazelcast-docker-swarm-discovery-spi

Docker Swarm based discovery strategy SPI for Hazelcast enabled applications
Apache License 2.0
39 stars 33 forks source link

TLS Support #4

Closed tunix closed 7 years ago

tunix commented 7 years ago

Hi @bitsofinfo,

When I look at the docker-java project's github pages, I can see that it's able to get DOCKER_HOST and DOCKER_CERT_PATH from the environment. I'm installing Docker Engine's using Docker Machine so it configures TLS certificates for all machines. When I pass these env vars to the service, it cannot connect to the master:

docker service create -d --name myapp --network foo \
  --constraint 'node.hostname == test2' \
  -e DOCKER_HOST="tcp://192.168.99.100:2376" \
  -e DOCKER_CERT_PATH="some_path" \
  -e JAVA_OPTS="-DdockerNetworkNames=foo -DdockerServiceNames=myapp" \
  tunix/myapp

Have you tested this with TLS and get it to work?

tunix commented 7 years ago

Sorry it's my bad. I forgot to mount host directory (certificates) to the container so it wasn't able to find the certificates. Thank you for this plugin btw!