Skip to content

Instantly share code, notes, and snippets.

View y0an's full-sized avatar

Yoan Rousseau y0an

View GitHub Profile
@y0an
y0an / create_swarm_cluster.sh
Created September 19, 2017 20:59 — forked from alexei-led/create_swarm_cluster.sh
Deploy Docker Compose (v3) to Swarm (mode) Cluster
#!/bin/bash
# vars
[ -z "$NUM_WORKERS" ] && NUM_WORKERS=3
# init swarm (need for service command); if not created
docker node ls 2> /dev/null | grep "Leader"
if [ $? -ne 0 ]; then
docker swarm init > /dev/null 2>&1
fi
@y0an
y0an / 01-docker-tls.sh
Created July 13, 2017 12:25 — forked from zigarn/01-docker-tls.sh
Generate Docker certificates for training on TLS
mkdir docker-ca
chmod 0700 docker-ca/
cd docker-ca/
# CA key
openssl genrsa -aes256 -out ca-key.pem 2048
# CA certificate
openssl req -new -x509 -days 365 -key ca-key.pem -sha256 -out ca.pem
# Server key