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

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
主站蜘蛛池模板: 阿城市| 梧州市| 多伦县| 蓝田县| 平江县| 常熟市| 河北省| 息烽县| 根河市| 新兴县| 斗六市| 郎溪县| 留坝县| 庐江县| 永春县| 宜良县| 津南区| 涿鹿县| 甘德县| 江都市| 常宁市| 万盛区| 疏勒县| 南皮县| 大兴区| 原平市| 馆陶县| 阿拉善右旗| 宜春市| 敖汉旗| 科技| 陈巴尔虎旗| 原平市| 临洮县| 高台县| 彰化市| 水城县| 平阴县| 乌鲁木齐市| 鲜城| 施甸县|