Created
March 24, 2023 09:12
-
-
Save chromabox/f31c10298e0ef520d50f619dabee31ac to your computer and use it in GitHub Desktop.
Dockerでオレオレ証明書を作成するスクリプト(Self-signed certificate)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 作りたい証明書のドメイン指定 | |
MY_DOMAIN=example.lan | |
# Key Accessで表示される表示名 | |
MY_CA_NAME=test-example-com-ca | |
# 証明書をDockerで生成(1年) | |
mkdir -p ${MY_DOMAIN}/certs && \ | |
docker run --rm -it \ | |
--name certs \ | |
-v $(pwd)/${MY_DOMAIN}/certs:/certs \ | |
-e SSL_SUBJECT=${MY_DOMAIN} \ | |
-e SSL_DNS=${MY_DOMAIN} \ | |
-e CA_EXPIRE=365 \ | |
-e SSL_EXPIRE=365 \ | |
-e CA_SUBJECT=${MY_CA_NAME} \ | |
stakater/ssl-certs-generator:1.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment