Last active
December 8, 2015 19:23
-
-
Save jcpst/2dbddcca9125898c4596 to your computer and use it in GitHub Desktop.
encrypt docker keys for codeship
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 | |
## Run in ~/.docker/machine/machines/your-machine-name | |
## Remove the commas & quotes in the Codeship build, which can be done like so: | |
## echo -e "$DOCKER_CA_PEM" | tr ',' '\n' | sed 's/"//' | head -c -1 > $HOME/.docker/ca.pem | |
echo DOCKER_CA_PEM=\"$(cat ca.pem | tr '\n' ',')\" >> deployment.env | |
echo DOCKER_CERT_PEM=\"$(cat cert.pem | tr '\n' ',')\" >> deployment.env | |
echo DOCKER_KEY_PEM=\"$(cat key.pem | tr '\n' ',')\" >> deployment.env | |
echo DOCKER_TLS_VERIFY=1 >> deployment.env | |
echo DOCKER_HOST=$(docker-machine ip $(basename $(pwd))):2376 >> deployment.env | |
echo DOCKER_CERT_PATH=/root/.docker >> deployment.env |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment