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

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

主站蜘蛛池模板: 珠海市| 房产| 上高县| 饶阳县| 咸丰县| 玛沁县| 新宁县| 巴马| 普陀区| 鹤山市| 玛多县| 黄浦区| 五莲县| 大埔县| 广元市| 巴林左旗| 许昌县| 安康市| 旬阳县| 岳普湖县| 巴林右旗| 五大连池市| 南川市| 阿瓦提县| 额敏县| 威宁| 南华县| 凤凰县| 景宁| 兴隆县| 康乐县| 青川县| 奉化市| 故城县| 获嘉县| 梅河口市| 伊金霍洛旗| 大城县| 南澳县| 遵化市| 理塘县|