Difference between revisions of "Docker Swarm"
Jump to navigation
Jump to search
(Created page with "List all containers over swarm ``` docker node ps $(docker node ls -q) ```") |
|||
Line 2: | Line 2: | ||
``` | ``` | ||
docker node ps $(docker node ls -q) | docker node ps $(docker node ls -q) | ||
+ | ``` | ||
+ | |||
+ | |||
+ | |||
+ | Enable tls | ||
+ | ``` | ||
+ | #!/usr/bin/env bash | ||
+ | set -e | ||
+ | # https://docs.docker.com/engine/security/protect-access/ | ||
+ | HOST=d3.uvoo.io | ||
+ | ipaddr=$(dig +short d3.uvoo.io) | ||
+ | |||
+ | openssl genrsa -aes256 -out ca-key.pem 4096 | ||
+ | openssl genrsa -out server-key.pem 4096 | ||
+ | openssl req -subj "/CN=$HOST" -sha256 -new -key server-key.pem -out server.csr | ||
+ | echo subjectAltName = DNS:$HOST,IP:$ipaddr,IP:127.0.0.1 >> extfile.cnf | ||
+ | echo extendedKeyUsage = serverAuth >> extfile.cnf | ||
+ | openssl x509 -req -days 365 -sha256 -in server.csr -CA ca.pem -CAkey ca-key.pem \ | ||
+ | -CAcreateserial -out server-cert.pem -extfile extfile.cnf | ||
``` | ``` |
Revision as of 18:28, 21 February 2021
List all containers over swarm
docker node ps $(docker node ls -q)
Enable tls
#!/usr/bin/env bash set -e # https://docs.docker.com/engine/security/protect-access/ HOST=d3.uvoo.io ipaddr=$(dig +short d3.uvoo.io) openssl genrsa -aes256 -out ca-key.pem 4096 openssl genrsa -out server-key.pem 4096 openssl req -subj "/CN=$HOST" -sha256 -new -key server-key.pem -out server.csr echo subjectAltName = DNS:$HOST,IP:$ipaddr,IP:127.0.0.1 >> extfile.cnf echo extendedKeyUsage = serverAuth >> extfile.cnf openssl x509 -req -days 365 -sha256 -in server.csr -CA ca.pem -CAkey ca-key.pem \ -CAcreateserial -out server-cert.pem -extfile extfile.cnf