官术网_书友最值得收藏!

Using Bash with Docker API to get the CLI bundle

Refer to the following steps:

  1. Before you start the process of downloading the command-line bundle through the API, make sure that you have the curl, jq (a lightweight formatter for JSON payloads), and unzip utilities installed:
sudo apt-get update && sudo apt-get install curl jq unzip
  1. Now, get the bearer token and call the API to retrieve the CLI files. Be sure to replace <ucp-ip> with the IP or DNS of your Docker PoC IP:
# Stash your Bearer token in an environment variable
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)"

# You are connected to the cluster - test it.
docker node ls
... listing of your Docker Enterprise nodes
主站蜘蛛池模板: 泰顺县| 自贡市| 安远县| 东宁县| 集安市| 临高县| 临汾市| 罗平县| 西峡县| 武鸣县| 苏尼特右旗| 城市| 忻城县| 东海县| 建水县| 连城县| 石楼县| 汤阴县| 汶川县| 高平市| 商丘市| 慈利县| 同仁县| 肇庆市| 奉节县| 尚志市| 赤城县| 滨海县| 永康市| 公安县| 上高县| 石狮市| 多伦县| 北京市| 澳门| 章丘市| 恩平市| 富川| 尚志市| 凤山市| 米脂县|