编程知识 cdmana.com

The newly released hub tool of docker can directly view account quota

Docker Desktop v3.0 It has been officially released in the last two weeks , From this version ,Docker The official promises that each update will be provided in the form of incremental updates , In order to reduce the size of the download package , Improve efficiency .

In addition to Docker Engine Update to v20.10.0 Outside , Other dependencies have also been updated , Here's the picture :

image

What attracts me most is the new Docker Hub Tool v0.2.0 , It is Docker Official Docker Hub CLI Tools , With management DockerHub Account number on , Image and other related resources .

following , Let me introduce you to Hub Tool The main function of .

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

From the first level menu , The main functions include :

  • Sign in / Log out DockerHub;
  • Account related management functions ;
  • Organization related management functions ;
  • Warehouse and tag Related management functions of ;
  • token Related management functions of ;

I'm currently using the latest version v0.2.0 .

(MoeLove) *  hub-tool version
Version:    v0.2.0
Git commit: 0edf43ac9091e7cac892cbc4cbc6efbafb665aa4

Sign in / sign out

Sign in / Exit as long as you execute hub-tool login perhaps hub-tool logout that will do .

But what we need to pay attention to here is Hub Tool Not used Docker Desktop Default user credentials , in other words , Even if you are in Docker Desktop You've logged in to your account , You also need to execute it on the terminal again login operation .

About why there is no shared user credentials , I talk to Docker Inc. I've been talking to your product manager , Because of the present Hub Tool Or an independent CLI Tools , Not with docker CLI To integrate , I don't think about integration for the time being . When you really want to integrate into docker CLI When , It will share user credentials directly .

(MoeLove) *  hub-tool login
Username: moelove
Password:

Account management

Two functions of account management :

  • View account information ;
  • View the traffic limit under the current account , I think this is a more useful function ;
(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

Organizational management

You can see ,hub-tool org Its function is to display some relevant information .

(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

Warehouse and tag management

Because both of them are directly related to the mirror image , I just got together to introduce .

  • Yes repo Query and delete function of :
(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
  • Yes tag A list of , Inquire about , View details and other functions . here You can see tag Last time Push/Pull operation , If next year Docker If you start to implement the image retention policy , I suggest you pay attention to ;
(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 Related management functions

For the individual Token The creation of / Delete , Activate / invalid , list , Query details and other functions .

(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

summary

That's about Docker Newly released Hub Tool All the functions of .
Now it's with Docker Desktop Together with , therefore Linux Not for the time being . But the plan is to open source as soon as possible . Coming soon !


Welcome to subscribe to my official account 【MoeLove】

TheMoeLove

版权声明
本文为[Zhang Jintao]所创,转载请带上原文链接,感谢
https://cdmana.com/2020/12/20201224141040568j.html

Scroll to Top