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

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

主站蜘蛛池模板: 那坡县| 通山县| 镇江市| 敖汉旗| 乌鲁木齐市| 甘谷县| 贡嘎县| 丹棱县| 迁西县| 镇雄县| 弥渡县| 进贤县| 布尔津县| 木里| 永善县| 电白县| 平江县| 金溪县| 中阳县| 安多县| 财经| 桂阳县| 竹溪县| 大城县| 北海市| 永善县| 梁河县| 鄂托克前旗| 枣庄市| 灵台县| 汤原县| 罗江县| 西吉县| 舞钢市| 晋城| 洪雅县| 信宜市| 安塞县| 吉首市| 临潭县| 吐鲁番市|