github.com/pdmccormick/importable-docker-buildx@v0.0.0-20240426161518-e47091289030/docs/reference/buildx_imagetools_create.md (about) 1 # buildx imagetools create 2 3 ```text 4 docker buildx imagetools create [OPTIONS] [SOURCE] [SOURCE...] 5 ``` 6 7 <!---MARKER_GEN_START--> 8 Create a new image based on source images 9 10 ### Options 11 12 | Name | Type | Default | Description | 13 |:---------------------------------|:--------------|:--------|:-----------------------------------------------------------------------------------------| 14 | [`--annotation`](#annotation) | `stringArray` | | Add annotation to the image | 15 | [`--append`](#append) | | | Append to existing manifest | 16 | [`--builder`](#builder) | `string` | | Override the configured builder instance | 17 | [`--dry-run`](#dry-run) | | | Show final image instead of pushing | 18 | [`-f`](#file), [`--file`](#file) | `stringArray` | | Read source descriptor from file | 19 | `--progress` | `string` | `auto` | Set type of progress output (`auto`, `plain`, `tty`). Use plain to show container output | 20 | [`-t`](#tag), [`--tag`](#tag) | `stringArray` | | Set reference for new image | 21 22 23 <!---MARKER_GEN_END--> 24 25 ## Description 26 27 Create a new manifest list based on source manifests. The source manifests can 28 be manifest lists or single platform distribution manifests and must already 29 exist in the registry where the new manifest is created. If only one source is 30 specified, create performs a carbon copy. 31 32 ## Examples 33 34 ### <a name="annotation"></a> Add annotations to an image (--annotation) 35 36 The `--annotation` flag lets you add annotations the image index, manifest, 37 and descriptors when creating a new image. 38 39 The following command creates a `foo/bar:latest` image with the 40 `org.opencontainers.image.authors` annotation on the image index. 41 42 ```console 43 $ docker buildx imagetools create \ 44 --annotation "index:org.opencontainers.image.authors=dvdksn" \ 45 --tag foo/bar:latest \ 46 foo/bar:alpha foo/bar:beta foo/bar:gamma 47 ``` 48 49 > **Note** 50 > 51 > The `imagetools create` command supports adding annotations to the image 52 > index and descriptor, using the following type prefixes: 53 > 54 > - `index:` 55 > - `manifest-descriptor:` 56 > 57 > It doesn't support annotating manifests or OCI layouts. 58 59 For more information about annotations, see 60 [Annotations](https://docs.docker.com/build/building/annotations/). 61 62 ### <a name="append"></a> Append new sources to an existing manifest list (--append) 63 64 Use the `--append` flag to append the new sources to an existing manifest list 65 in the destination. 66 67 ### <a name="builder"></a> Override the configured builder instance (--builder) 68 69 Same as [`buildx --builder`](buildx.md#builder). 70 71 ### <a name="dry-run"></a> Show final image instead of pushing (--dry-run) 72 73 Use the `--dry-run` flag to not push the image, just show it. 74 75 ### <a name="file"></a> Read source descriptor from a file (-f, --file) 76 77 ```text 78 -f FILE or --file FILE 79 ``` 80 81 Reads source from files. A source can be a manifest digest, manifest reference, 82 or a JSON of OCI descriptor object. 83 84 In order to define annotations or additional platform properties like `os.version` and 85 `os.features` you need to add them in the OCI descriptor object encoded in JSON. 86 87 ```console 88 $ docker buildx imagetools inspect --raw alpine | jq '.manifests[0] | .platform."os.version"="10.1"' > descr.json 89 $ docker buildx imagetools create -f descr.json myuser/image 90 ``` 91 92 The descriptor in the file is merged with existing descriptor in the registry if it exists. 93 94 The supported fields for the descriptor are defined in [OCI spec](https://github.com/opencontainers/image-spec/blob/master/descriptor.md#properties) . 95 96 ### <a name="tag"></a> Set reference for new image (-t, --tag) 97 98 ```text 99 -t IMAGE or --tag IMAGE 100 ``` 101 102 Use the `-t` or `--tag` flag to set the name of the image to be created. 103 104 ```console 105 $ docker buildx imagetools create --dry-run alpine@sha256:5c40b3c27b9f13c873fefb2139765c56ce97fd50230f1f2d5c91e55dec171907 sha256:c4ba6347b0e4258ce6a6de2401619316f982b7bcc529f73d2a410d0097730204 106 $ docker buildx imagetools create -t tonistiigi/myapp -f image1 -f image2 107 ```