Docker with remote servers

If you’re running Docker without TLS (hopefully never in production, for dev only), set DOCKER_HOST to host-ip:2375 and should should be good to go:

export DOCKER_HOST=tcp://host-ip:2375

If you’re using TLS certs, point to 2376 on the remote machine and specify a path to the certs:

export DOCKER_HOST=tcp://host-ip:2376
export DOCKER_CERT_PATH=/path/to/certs

Pass the –tlsverify param to ensure certs are passed with command:

docker --tlsverify command

 

Use docker-compose against a remote machine with TLS certs:

docker-compose -H remote-server-ip:2376 --tlscacert ca.pem --tlscert cert.pem --tlskey key.pem -f docker-compose.yml up

How to setup your Docker server to use TLS certs is here: https://docs.docker.com/engine/security/https/

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.