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

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
主站蜘蛛池模板: 双城市| 滦南县| 江门市| 临澧县| 鄱阳县| 江孜县| 南阳市| 华池县| 来凤县| 洮南市| 屏东县| 巨鹿县| 阿城市| 桓台县| 仪陇县| 安康市| 客服| 收藏| 呼伦贝尔市| 曲水县| 江阴市| 乐昌市| 高碑店市| 肥西县| 阜平县| 丰原市| 尚志市| 乌鲁木齐市| 龙江县| 舟曲县| 苍溪县| 西峡县| 中宁县| 沈丘县| 额尔古纳市| 无极县| 拉孜县| 宜章县| 洮南市| 聂荣县| 景东|