- Mastering Docker Enterprise
- Mark Panthofer
- 166字
- 2021-07-02 12:30:16
Using PowerShell with the Docker API to get the CLI bundle
If you would rather connect to your EE cluster with a standard Windows PowerShell, use the following commands. Again, be sure to replace the <username>, <password>, and <ucp-ip> with the IP or DNS of your Docker PoC IP:
PS> $AUTHTOKEN=((Invoke-WebRequest -Body '{"username":"<username>", "password":"<password>"}' -Uri https://<ucp-ip>/auth/login -Method POST).Content)|ConvertFrom-Json|select auth_token -ExpandProperty auth_token
PS> [io.file]::WriteAllBytes("ucp-bundle.zip", ((Invoke-WebRequest -Uri https://<ucp-ip>/api/clientbundle -Headers @{"Authorization"="Bearer $AUTHTOKEN"}).Content))
PS> Expand-Archive -Path ucp-bundle.zip -DestinationPath .
PS> Import-Module .\env.ps1
Security warning
Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your
computer. If you trust this script, use the Unblock-File cmdlet to allow the script to run without this warning
message. Do you want to run C:\Users\Administrator\PoC CLI\env.ps1?
[D] Do not run [R] Run once [S] Suspend [?] Help (default is "D"): R
PS> docker node ls
... listing of your Docker Enterprise nodes
Visit the Docker docs here for more information on the command-line bundle: https://docs.docker.com/ee/ucp/user-access/cli/.
推薦閱讀
- 大學計算機信息技術導論
- 人工智能超越人類
- 會聲會影X5視頻剪輯高手速成
- Mastering VMware vSphere 6.5
- 人工智能與人工生命
- Arduino &樂高創意機器人制作教程
- Visual C++項目開發案例精粹
- INSTANT Adobe Story Starter
- Spark大數據商業實戰三部曲:內核解密|商業案例|性能調優
- PowerPoint 2010幻燈片制作高手速成
- FreeCAD [How-to]
- 時序大數據平臺TDengine核心原理與實戰
- 亮劍.NET:圖解ASP.NET網站開發實戰
- Practical Internet of Things with JavaScript
- 智能移動機器人的設計、制作與應用