1
0
mirror of https://github.com/openshift/source-to-image.git synced 2026-02-05 12:44:54 +01:00
Files
source-to-image/docs/new_labels.md
jkim 2dedbd8635 update to add and/or update docker labels with a JSON file
add a new md file in /docs folder
2017-06-21 08:37:09 -04:00

923 B

Adding New Labels

New Docker Labels may be created and/or updated for the output image via the image metadata file.

If a new label is specified in the metadata file, the label will be added in the output image. However, any label previously defined in the base builder image will be overwritten in the output image, if the same label name is specified in the image metadata file.

Image Metadata File Name and Path

The name and path of the file must be the following:

/tmp/.s2i/image_metadata.json

Example

The file may have one or more label/value pairs. Below is the JSON format of the labels, in the image metadata file:

{
  "labels": [
    {"labelkey1":"value1"},
    {"labelkey2":"value2"},
    .........
  ]
}

Note: If the JSON format is different than shown above, it will cause an error.

Creating the File

The file should be created during the assemble step.