- Mastering Docker Enterprise
- Mark Panthofer
- 151字
- 2021-07-02 12:30:16
Using Bash with Docker API to get the CLI bundle
Refer to the following steps:
- 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
- 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
推薦閱讀
- 精通MATLAB圖像處理
- 模型制作
- MicroPython Projects
- JSP從入門到精通
- Learning C for Arduino
- 大數(shù)據(jù)驅(qū)動(dòng)的設(shè)備健康預(yù)測及維護(hù)決策優(yōu)化
- Storm應(yīng)用實(shí)踐:實(shí)時(shí)事務(wù)處理之策略
- 在實(shí)戰(zhàn)中成長:Windows Forms開發(fā)之路
- 電氣控制與PLC原理及應(yīng)用(歐姆龍機(jī)型)
- 大數(shù)據(jù)案例精析
- Linux系統(tǒng)管理員工具集
- Photoshop CS4數(shù)碼攝影處理50例
- 基于Proteus的單片機(jī)應(yīng)用技術(shù)
- 玩轉(zhuǎn)PowerPoint
- Eclipse全程指南