Current location - Quotes Website - Personality signature - Detailed description of the dock manifest
Detailed description of the dock manifest
Added (# 138) in version 18.02.

Reference link:/engine/reference/commandline/manifest/# push-to-an-insert-registry.

? /p/fad6b6fb4599

The docker manifest command itself does nothing. There must be a subcommand in order to manipulate the manifest or manifest list.

The 1. list is a file containing image information, such as layer, size and summary. The docker manifest command also provides users with additional information, such as the operating system and architecture used to build the image.

2. Inventory list is a list of mirror layers created by setting one or more mirror names, which can be used as mirror names in docker pull and docker run commands.

Ideally, the manifest is built from images of the same function and different os/arch combinations. Therefore, manifest is often called "multi-architecture mirror".

However, users can create a list pointing to two mirrors and then provide users with a unique mirror name. Such as: one for Windows on amd64 and one for darwin on amd.

Starting from Docker registry v2.3 and Docker 1. 10, Docker hub can build Docker images.

Checklist-Help

Usage: docker manifest inspect [options] [manifest _ list] list

Displays an inventory or inventory list of mirrors.

Options:

-Help usage

-Insecure? Allow communication with an insecure registry.

-v,-wordy? Other information outputs include layers and platforms.

Usage: docker manifest create manifest _ list manifest [manifest ...]

Create a local manifest list for comments and push to the registry.

Create a local manifest for annotations and push it into the mirror repository.

Options:

-a,-Modify the existing manifest.

-Insecure? Allow communication with an insecure registry.

-Help usage

Usage: docker list comments [options] MANIFEST_LIST list

Add additional information to the list of local mirrors.

Options:

? Bowstring? Set the schema

? -Help? use

? -os string? Set the operating system

? -OS-versionstring sets the operating system version.

? -os-features string slice? Set operating system functions

? -Variant string? Set schema variation

Usage: docker manifest push [options] manifest _ list

Push the inventory list to the repository

Options:

? -Help? use

? -Unsafe. It is allowed to be pushed to an unsafe warehouse.

? -p- Purification? Delete local inventory list after push.

The manifest command only interacts with the Docker repository. Therefore, it cannot query the engine for the list of allowed unsafe warehouses. In order to allow CLI to interact with unsafe warehouses, some docker manifest commands are marked with -insecurity. For each transaction that create queries the registry (for example), -unsecured must specify a flag. This flag tells the CLI that this registry call may ignore security issues, such as missing certificates or self-signed certificates. Similarly, this flag must be specified when manifest is pushed to an unsafe warehouse. If it is not used with unsafe warehouses, the inventory command will not find warehouses that meet the default requirements.

1. Check the mirror manifest object.

``

$ TERM docker list check hello-world

{

“schema version”:2,

" media type ":" application/vnd . docker . distribution . manifest . v2+JSON ",

"Configuration": {

" media type ":" application/vnd . docker . container . image . v 1+JSON ",

[size]: 1520,

Abstract: "SHA256:1815c82652c03bfd8644afd26fb184f2ed891d 921b20a0703b46768f9755c57"

},

"Layer": [

{

" media type ":" application/vnd . docker . image . root fs . diff . tar . gzip ",

"Size": 972,

Abstract: "SHA 256: B04784 FBA 78D739B526E27EDC02A 5A8CD 07B1052E9283F5 FC155828F4 B614C28"

}

]

}

``

2. Check the image list and get os/arch information.

The docker manifest inspect command has an optional-verbose flag, which can provide the name (Ref), architecture and os (platform) of the image. Just like other docker commands that use image names, you can refer to tagged images, unlabeled images, or abstract (for example, hello-world @ sha256: f3b3b28a45160805bb16542c95318885/kloc-).

This is an example of checking the mirror list with the-verbose flag:

$ TERM Checklist-Detailed hello-world

{

"ref": "docker.io/library/hello-world: latest",

Abstract: "SHA 256: F3 B3 B28A 45/KOC-0/60805B/KOC-0/6542C 953/KOC-0/8885/KOC-0/9430E96D6FFC09D7226/KOC-0/B0D26FF726".

" SchemaV2Manifest": {

“schema version”:2,

" media type ":" application/vnd . docker . distribution . manifest . v2+JSON ",

"Configuration": {

" media type ":" application/vnd . docker . container . image . v 1+JSON ",

[size]: 1520,

Abstract: "SHA256:1815c82652c03bfd8644afd26fb184f2ed891d 921b20a0703b46768f9755c57"

},

"Layer": [

{

" media type ":" application/vnd . docker . image . root fs . diff . tar . gzip ",

"Size": 972,

Abstract: "SHA 256: B04784 FBA 78D739B526E27EDC02A 5A8CD 07B1052E9283F5 FC155828F4 B614C28"

}

]

},

Platform: {

"architecture": "amd64",

"operating system": "linux"

}

}

3. Create and push the inventory list.

To create an inventory list, first create the inventory list locally by specifying the component images to be included in the inventory list. Remember, this has been pushed to the mirror repository, so if you want to push to a repository other than the docker mirror repository, you need to create an inventory list with the repository name or IP and port. This is similar to marking a mirror and pushing it to an external mirror library.

After creating a local copy of the inventory list, you can choose to annotate it. Allowed comments include architecture and operating system (overwriting the current value of the image), operating system features, and architectural variants.

Finally, the inventory list needs to be pushed to the required mirror bin. The following is a description of these three commands and an example of combining them.

$ docker list creation 45.55.81.106: 5000/coolapp: v1\

45 . 55 . 8 1. 106:5000/coolapp-PPC 64 le-Linux:v 1 \

45 . 55 . 8 1. 106:5000/coolapp-arm-Linux:v 1 \

45 . 55 . 8 1. 106:5000/coolapp-amd64-Linux:v 1 \

45 . 55 . 8 1. 106:5000/coolapp-amd64-windows:v 1

Inventory list 45.55.81.106: 5000/coolapp: v1

Note 45.55.81.106: 5000/coolapp: v145.55.81.106: 5000/coolapp-

$ docker list push 45.55.81.106: 5000/coolapp: v1

The list 45.55.81.106: 5000/coolapp @ sha256: 9701edc93223a6e49dd6c894a1db8c2cf has been pushed.

The list 45.55.81.106: 5000/coolapp @ sha 256: f3b3b28a45160805bb16542c9531885 has been pushed.

Pushed list 45.55.81.106: 5000/coolapp @ sha256: 39dc41c658cf25f33681a413/kloc-.

Use the summary to push the list 45.55.81.106: 5000/coolapp @ sha256: f 91b145d4ac800b281223/kloc-0.

sha 256:050 b 2 13d 49d 7673 ba 350 14f 2 1454 c 573 dcb EC 75254 a 08 f 4 a 7 c 34 f 66 a 47 c 06 ABA

Checklist list

$ docker inventory check coolapp:v 1

{

? “schema version”:2,

? " media type ":" application/vnd . docker . distribution . manifest . list . v2+JSON ",

? "List": [

? {

" media type ":" application/vnd . docker . distribution . manifest . v2+JSON ",

[size]: 424,

Abstract: "SHA 256: F67DCC5FC 786F04F0743A BFE0EE5DAE9BD8CAF8a6fA6C8144F7F2 A43889DC513B",

Platform: {

"architecture": "arm",

"operating system": "linux"

}

? },

? {

" media type ":" application/vnd . docker . distribution . manifest . v2+JSON ",

[size]: 424,

Abstract: "SHA 256: B 64 CA0B 60356A 30971F 098C92200B1271257F100A55B351E6BB98563835"

Platform: {

"architecture": "amd64",

"operating system": "linux"

}

? },

? {

" media type ":" application/vnd . docker . distribution . manifest . v2+JSON ",

[size]: 425,

Abstract: "SHA 256: DF 436846483 AFF 62 BAD 830B 730A 0D3 B7731BCF 98BA5E470A 8BBB8E9E346E4E8",

Platform: {

Architecture: ppc64le,

"operating system": "linux"

}

? },

? {

" media type ":" application/vnd . docker . distribution . manifest . v2+JSON ",

[size]: 425,

Abstract: "Sha 256: 5 BB8E50AA2EDD408 BDF3DDF61EFB7338FF34A07B762992C9432F1C02FC0E5E62",

Platform: {

"architecture": "s390x",

"operating system": "linux"

}

? }

? ]

}

Push to the unsafe mirror warehouse.

$ docker Inventory Creation-Unsafe myprivateregistry.mycompany.com/repo/image:1.0 \

my private registry . my company . com/repo/image-Linux-PPC 64 le: 1.0 \

my private registry . my company . com/repo/image-Linux-s390x: 1.0 \

my private registry . my company . com/repo/image-Linux-arm: 1.0 \

my private registry . my company . com/repo/image-Linux-armhf: 1.0 \

my private registry . my company . com/repo/image-windows-amd64: 1.0 \

my private registry . my company . com/repo/image-Linux-amd64: 1.0

$ TERM List Push-Unsafe myprivateregistry.mycompany.com/repo/image:tag