关于docker:Docker-新发布的-hubtool-可直接查看账户配额

46次阅读

共计 4869 个字符,预计需要花费 13 分钟才能阅读完成。

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 -h
A tool to manage your Docker Hub images

Usage:
  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 tool

Flags:
  -h, --help      help for hub-tool
      --verbose   Print logs
      --version   Display the version of this tool

Use "hub-tool [command] --help" for more information about a command.

从一级菜单来看,次要性能包含:

  • 登录 / 登出 DockerHub;
  • 账户相干治理性能;
  • 组织相干治理性能;
  • 仓库和 tag 的相干治理性能;
  • token 的相干治理性能;

以后我应用的是最新版本 v0.2.0。

(MoeLove) ➜  hub-tool version
Version:    v0.2.0
Git 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 login
Username: moelove
Password:

账户治理

账户治理的两个性能:

  • 查看账户信息;
  • 查看以后账户下的流量限度 , 这是我集体感觉比拟有用的一个性能;
(MoeLove) ➜  hub-tool account
Manage your account

Usage:
  hub-tool account
  hub-tool account [command]

Available Commands:
  info          Print the account information
  rate-limiting Print the rate limiting information

Flags:
  -h, --help   help for account

Global Flags:
      --verbose   Print logs

Use "hub-tool account [command] --help" for more information about a command.
(MoeLove) ➜  hub-tool account rate-limiting
Limit:     200, 6 hours window
Remaining: 200, 6 hours window
(MoeLove) ➜  hub-tool account info
Username:    moelove.info
Full name:    Jintao Zhang
Company:
Location:
Joined:        6 years ago
Plan:        free
Limits:
  Seats:        1
  Private repositories:    1
  Parallel builds:    1
  Collaborators:    unlimited
  Teams:        unlimited

组织治理

能够看到,hub-tool org 的性能就是展现一些相干信息了。

(MoeLove) ➜  hub-tool org
Manage organizations

Usage:
  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 organization

Flags:
  -h, --help   help for org

Global Flags:
      --verbose   Print logs

Use "hub-tool org [command] --help" for more information about a command.
(MoeLove) ➜  hub-tool org ls
NAMESPACE    NAME    MY ROLE    TEAMS    MEMBERS

仓库和 tag 治理

因为这两个都和镜像有间接的关系,我就聚合到一起介绍了。

  • 对 repo 的查问和删除性能:
(MoeLove) ➜  hub-tool repo -h
Manage repositories

Usage:
  hub-tool repo
  hub-tool repo [command]

Available Commands:
  ls          List all the repositories from your account or an organization
  rm          Delete a repository

Flags:
  -h, --help   help for repo

Global Flags:
      --verbose   Print logs

Use "hub-tool repo [command] --help" for more information about a command.
(MoeLove) ➜  hub-tool repo ls
REPOSITORY                             DESCRIPTION       LAST UPDATE      PULLS    STARS    PRIVATE
taobeier/saythx-work                                     2 years ago      56989    0        false
...
(MoeLove) ➜  hub-tool repo ls -h
List all the repositories from your account or an organization

Usage:
  hub-tool repo ls [ORGANIZATION]

Aliases:
  ls, list

Flags:
      --all             Fetch all available repositories
      --format string   Print values using a custom format ("json")
  -h, --help            help for ls

Global Flags:
      --verbose   Print logs
  • 对 tag 的列表,查问,查看具体等性能。这里 能够看到 tag 最近一次的 Push/Pull 操作,如果明年 Docker 开始履行镜像保留策略的话,我倡议你关注一下
(MoeLove) ➜  hub-tool tag
Manage tags

Usage:
  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 repository

Flags:
  -h, --help   help for tag

Global Flags:
      --verbose   Print logs

Use "hub-tool tag [command] --help" for more information about a command.
See 'hub-tool tag ls --help'.

Usage:  hub-tool tag ls [OPTION] REPOSITORY

List all the images in a repository
(MoeLove) ➜  hub-tool tag ls taobeier/saythx-work
TAG                            DIGEST                                                                     STATUS    LAST UPDATE    LAST PUSHED    LAST PULLED    SIZE
taobeier/saythx-work:latest    sha256:3133a607d062dd3a8b46f38c8271099c258f5e59cecd652bebddf6e15789cb32    active    2 years ago    2 years        6 days         52.94MB
taobeier/saythx-work:1.0       sha256:3133a607d062dd3a8b46f38c8271099c258f5e59cecd652bebddf6e15789cb32    active    2 years ago    2 years        6 days         52.94MB

Token 相干治理性能

对集体 Token 的创立 / 删除,激活 / 生效,列表,查问具体等性能。

(MoeLove) ➜  hub-tool token -h
Manage Personal Access Tokens

Usage:
  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 Token

Flags:
  -h, --help   help for token

Global Flags:
      --verbose   Print logs

Use "hub-tool token [command] --help" for more information about a command.
(MoeLove) ➜  hub-tool token ls
DESCRIPTION               UUID                                    LAST USED       CREATED      ACTIVE
test-docker-token         xxxxxxxx-xxxx-xxxx-xxxx-moelove.info    9 months ago    9 months     true
(MoeLove) ➜  hub-tool token inspect xxxxxxxx-xxxx-xxxx-xxxx-moelove.info
Token:
UUID:    xxxxxxxx-xxxx-xxxx-xxxx-moelove.info
Description:    test-docker-token
Is Active:    true
Created:    9 months ago
Last Used:    9 months ago
Creator User Agent:    Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.4103.116 Safari/537.36
Creator IP:    100.000.000.00
Generated:    By user via Web UI

总结

以上就是对于 Docker 新公布的 Hub Tool 的全副性能介绍了。
以后它是随着 Docker Desktop 一起发行的,所以 Linux 下临时没有。然而打算会尽快开源。敬请期待!


欢送订阅我的文章公众号【MoeLove】

正文完
 0