Docker Desktop v3.0 已于前两周正式公布,从这个版本起,Docker 官网承诺每次的更新将以增量更新的形式来提供,以便缩小下载包的体积,晋升效率。
除了将 Docker Engine 更新至 v20.10.0 外,也对其余的依赖做了更新,如下图:
最吸引我的是本次新增的 Docker Hub Tool v0.2.0 ,它是 Docker 官网提供的 Docker Hub CLI 工具,具备治理 DockerHub 上的帐号,镜像等相干资源的能力。
以下,我来为你介绍下 Hub Tool 的次要性能。
(MoeLove) ➜ hub-tool -hA tool to manage your Docker Hub imagesUsage: hub-tool hub-tool [command]Available Commands: account Manage your account help Help about any command login Login to the Hub logout Logout of the Hub org Manage organizations repo Manage repositories tag Manage tags token Manage Personal Access Tokens version Version information about this toolFlags: -h, --help help for hub-tool --verbose Print logs --version Display the version of this toolUse "hub-tool [command] --help" for more information about a command.
从一级菜单来看,次要性能包含:
- 登录/登出 DockerHub;
- 账户相干治理性能;
- 组织相干治理性能;
- 仓库和 tag 的相干治理性能;
- token 的相干治理性能;
以后我应用的是最新版本 v0.2.0 。
(MoeLove) ➜ hub-tool versionVersion: v0.2.0Git commit: 0edf43ac9091e7cac892cbc4cbc6efbafb665aa4
登录/退出
登录/退出只有执行 hub-tool login
或者 hub-tool logout
即可。
但这里须要留神的是 Hub Tool 并没有应用 Docker Desktop 默认的用户凭证,也就是说,即便你在 Docker Desktop 中曾经登录了帐号,你同样还是须要再次在终端下执行 login 操作。
对于为何没有共用用户凭证的问题,我跟 Docker Inc. 的产品经理聊过,是因为以后 Hub Tool 还是一个独立的 CLI 工具,并没有与 docker CLI 进行集成,也临时没想好要如何集成。等真正要集成进 docker CLI 的时候,就会间接共用用户凭证了。
(MoeLove) ➜ hub-tool loginUsername: moelovePassword:
账户治理
账户治理的两个性能:
- 查看账户信息;
- 查看以后账户下的流量限度 , 这是我集体感觉比拟有用的一个性能;
(MoeLove) ➜ hub-tool accountManage your accountUsage: hub-tool account hub-tool account [command]Available Commands: info Print the account information rate-limiting Print the rate limiting informationFlags: -h, --help help for accountGlobal Flags: --verbose Print logsUse "hub-tool account [command] --help" for more information about a command.(MoeLove) ➜ hub-tool account rate-limitingLimit: 200, 6 hours windowRemaining: 200, 6 hours window(MoeLove) ➜ hub-tool account infoUsername: moelove.infoFull name: Jintao ZhangCompany:Location:Joined: 6 years agoPlan: freeLimits: Seats: 1 Private repositories: 1 Parallel builds: 1 Collaborators: unlimited Teams: unlimited
组织治理
能够看到,hub-tool org
的性能就是展现一些相干信息了。
(MoeLove) ➜ hub-tool orgManage organizationsUsage: hub-tool org hub-tool org [command]Available Commands: ls List all the organizations members List all the members in an organization teams List all the teams in an organizationFlags: -h, --help help for orgGlobal Flags: --verbose Print logsUse "hub-tool org [command] --help" for more information about a command.(MoeLove) ➜ hub-tool org lsNAMESPACE NAME MY ROLE TEAMS MEMBERS
仓库和 tag 治理
因为这两个都和镜像有间接的关系,我就聚合到一起介绍了。
- 对 repo 的查问和删除性能:
(MoeLove) ➜ hub-tool repo -hManage repositoriesUsage: hub-tool repo hub-tool repo [command]Available Commands: ls List all the repositories from your account or an organization rm Delete a repositoryFlags: -h, --help help for repoGlobal Flags: --verbose Print logsUse "hub-tool repo [command] --help" for more information about a command.(MoeLove) ➜ hub-tool repo lsREPOSITORY DESCRIPTION LAST UPDATE PULLS STARS PRIVATEtaobeier/saythx-work 2 years ago 56989 0 false...(MoeLove) ➜ hub-tool repo ls -hList all the repositories from your account or an organizationUsage: hub-tool repo ls [ORGANIZATION]Aliases: ls, listFlags: --all Fetch all available repositories --format string Print values using a custom format ("json") -h, --help help for lsGlobal Flags: --verbose Print logs
- 对 tag 的列表,查问,查看具体等性能。 这里 能够看到 tag 最近一次的 Push/Pull 操作,如果明年 Docker 开始履行镜像保留策略的话,我倡议你关注一下 ;
(MoeLove) ➜ hub-tool tagManage tagsUsage: hub-tool tag [flags] hub-tool tag [command]Available Commands: inspect Show the details of an image in the registry ls List all the images in a repository rm Delete a tag in a repositoryFlags: -h, --help help for tagGlobal Flags: --verbose Print logsUse "hub-tool tag [command] --help" for more information about a command.See 'hub-tool tag ls --help'.Usage: hub-tool tag ls [OPTION] REPOSITORYList all the images in a repository(MoeLove) ➜ hub-tool tag ls taobeier/saythx-workTAG DIGEST STATUS LAST UPDATE LAST PUSHED LAST PULLED SIZEtaobeier/saythx-work:latest sha256:3133a607d062dd3a8b46f38c8271099c258f5e59cecd652bebddf6e15789cb32 active 2 years ago 2 years 6 days 52.94MBtaobeier/saythx-work:1.0 sha256:3133a607d062dd3a8b46f38c8271099c258f5e59cecd652bebddf6e15789cb32 active 2 years ago 2 years 6 days 52.94MB
Token 相干治理性能
对集体 Token 的创立/删除,激活/生效,列表,查问具体等性能。
(MoeLove) ➜ hub-tool token -hManage Personal Access TokensUsage: hub-tool token [flags] hub-tool token [command]Available Commands: activate Activate a Personal Access Token create Create a Personal Access Token deactivate Deactivate a Personal Access Token inspect Inspect a Personal Access Token ls List all the Personal Access Tokens rm Delete a Personal Access TokenFlags: -h, --help help for tokenGlobal Flags: --verbose Print logsUse "hub-tool token [command] --help" for more information about a command.(MoeLove) ➜ hub-tool token lsDESCRIPTION UUID LAST USED CREATED ACTIVEtest-docker-token xxxxxxxx-xxxx-xxxx-xxxx-moelove.info 9 months ago 9 months true(MoeLove) ➜ hub-tool token inspect xxxxxxxx-xxxx-xxxx-xxxx-moelove.infoToken:UUID: xxxxxxxx-xxxx-xxxx-xxxx-moelove.infoDescription: test-docker-tokenIs Active: trueCreated: 9 months agoLast Used: 9 months agoCreator User Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.4103.116 Safari/537.36Creator IP: 100.000.000.00Generated: By user via Web UI
总结
以上就是对于 Docker 新公布的 Hub Tool 的全副性能介绍了。
以后它是随着 Docker Desktop 一起发行的,所以 Linux 下临时没有。然而打算会尽快开源。敬请期待!
欢送订阅我的文章公众号【MoeLove】