Last active
August 29, 2015 14:24
-
-
Save enil/52bf5ea01b202f8ab78a to your computer and use it in GitHub Desktop.
Easily curl into the Docker REST API (ZSH only)
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
curldocker() { | |
local args | |
local endpoint | |
args=(${@:1:$(( $# - 1 ))}) | |
endpoint=${@[$#]} | |
curl --silent \ | |
--key $DOCKER_CERT_PATH/key.pem \ | |
--cert $DOCKER_CERT_PATH/cert.pem \ | |
--cacert $DOCKER_CERT_PATH/ca.pem \ | |
${args[*]} \ | |
$(echo $DOCKER_HOST | sed 's/^tcp/https/')/$endpoint | |
return $? | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment