Skip to content

Instantly share code, notes, and snippets.

@collabnix
Created October 19, 2018 11:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save collabnix/30c9f772445076d765f7b91ce7d3c7cb to your computer and use it in GitHub Desktop.
Save collabnix/30c9f772445076d765f7b91ce7d3c7cb to your computer and use it in GitHub Desktop.
Installing Docker Client Bundle for Docker Enterprise 2.0
#Download client certificates by using the REST API
#You can also download client bundles by using the UCP REST API. In this example, we use curl to make the web requests to the API, jq to parse the responses, and unzip to unpack the zip archive.
#To install these tools on an Ubuntu distribution, you can run:
sudo apt-get update && sudo apt-get install curl jq unzip
# Create an environment variable with the user security token
AUTHTOKEN=$(curl -sk -d '{"username":"<username>","password":"<password>"}' https://<ucp-ip>/auth/login | jq -r .auth_token)
# Download the client certificate bundle
curl -k -H "Authorization: Bearer $AUTHTOKEN" https://<ucp-ip>/api/clientbundle -o bundle.zip
# Unzip the bundle.
unzip bundle.zip
# Run the utility script.
eval "$(<env.sh)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment