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

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
主站蜘蛛池模板: 含山县| 横峰县| 塘沽区| 遂宁市| 周口市| 城市| 广东省| 蛟河市| 陆河县| 克什克腾旗| 梁河县| 通榆县| 墨竹工卡县| 邵东县| 秀山| 阳泉市| 松江区| 虹口区| 西平县| 连城县| 玉山县| 新化县| 隆回县| 钟祥市| 淳安县| 满城县| 怀来县| 韩城市| 探索| 日喀则市| 郎溪县| 冀州市| 晋州市| 九龙县| 内乡县| 行唐县| 汨罗市| 阿图什市| 雅江县| 介休市| 普定县|