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

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

主站蜘蛛池模板: 天镇县| 彭泽县| 广汉市| 宁安市| 聂拉木县| 福安市| 遵义县| 柯坪县| 尚志市| 阳谷县| 信宜市| 维西| 盘锦市| 德惠市| 宜兴市| 永修县| 蕲春县| 福建省| 苍南县| 沁源县| 塔城市| 大方县| 东平县| 四子王旗| 金平| 德钦县| 成安县| 霍山县| 阿克陶县| 内江市| 渑池县| 常山县| 宜君县| 团风县| 闻喜县| 延长县| 济宁市| 苗栗市| 余干县| 剑河县| 宁夏|