Skip to content

Instantly share code, notes, and snippets.

@enil
Last active August 29, 2015 14:24
Show Gist options
  • Save enil/52bf5ea01b202f8ab78a to your computer and use it in GitHub Desktop.
Save enil/52bf5ea01b202f8ab78a to your computer and use it in GitHub Desktop.
Easily curl into the Docker REST API (ZSH only)
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