-
-
Notifications
You must be signed in to change notification settings - Fork 80
Docker Secrets
Justin J. Novack edited this page Oct 27, 2019
·
1 revision
# ssh-keygen -t rsa -b 4096 -C "autossh" -f autossh_id_rsa
# cat autossh_id_rsa | docker secret create autossh_id_rsa -
# ssh-copy-id -i autossh_id_rsa [email protected]
docker-compose-swarm.yml
version: '3.7'
services:
service:
image: jnovack/autossh:latest
environment:
- SSH_KEY_FILE=/run/secrets/autossh_id_rsa
- SSH_HOSTUSER=username
- SSH_HOSTNAME=203.0.113.10
- SSH_TUNNEL_REMOTE=2222
- SSH_TUNNEL_HOST=172.17.0.1
- SSH_TUNNEL_LOCAL=22
- TERM=xterm
deploy:
replicas: 1
placement:
constraints:
- node.role == manager
restart_policy:
condition: any
secrets:
- autossh_id_rsa
secrets:
autossh_id_rsa:
external: true
# docker stack deploy -c docker-compose-swarm.yml autossh