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

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/.

主站蜘蛛池模板: 眉山市| 漾濞| 榆林市| 海伦市| 永平县| 万荣县| 凭祥市| 阿荣旗| 托里县| 黄梅县| 奉新县| 小金县| 岗巴县| 那曲县| 八宿县| 苏尼特左旗| 太康县| 桐城市| 温宿县| 新宁县| 阳江市| 图片| 射洪县| 长治县| 扎囊县| 建水县| 翼城县| 塔河县| 连城县| 兰州市| 长武县| 平潭县| 娄底市| 龙岩市| 军事| 岳阳县| 吉隆县| 桂阳县| 巴塘县| 习水县| 青田县|