Last active
August 29, 2015 14:01
-
-
Save fermayo/84d59bbd257acdfbd5d7 to your computer and use it in GitHub Desktop.
Generate a key pair for Docker
This file contains hidden or 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/sh | |
| CERT_PATH="$HOME/.docker" | |
| mkdir -p ${CERT_PATH} | |
| if [ ! -f "$CERT_PATH/key.pem" ]; then | |
| echo "Generating a new certificate in $CERT_PATH..." | |
| openssl req -new -newkey rsa:4096 -days 3650 -nodes -x509 -subj "/C=US/ST=NewYork/L=NYC/O=Tutum/CN=tutum.user" -keyout ${CERT_PATH}/key.pem -out ${CERT_PATH}/cert.pem >/dev/null 2>&1 | |
| echo "This is your new public certificate which you can add to your Tutum account:" | |
| else | |
| echo "WARNING: An existing certificate has been found in $CERT_PATH" | |
| echo "This is your existing public certificate which you can add to your Tutum account:" | |
| fi | |
| cat ${CERT_PATH}/cert.pem |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment