Skip to content

Instantly share code, notes, and snippets.

@jcpst
Last active December 8, 2015 19:23
Show Gist options
  • Save jcpst/2dbddcca9125898c4596 to your computer and use it in GitHub Desktop.
Save jcpst/2dbddcca9125898c4596 to your computer and use it in GitHub Desktop.
encrypt docker keys for codeship
#!/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