A plugin for pushing Docker manifest multi-architecture image files.
cnbcool/manifest:latest
main:
push:
# Example 1: Image source is `hub.docker.com`
# The following configuration will merge `foo/bar:v1.0.0-linux-amd64` and `foo/bar:v1.0.0-linux-arm64` to generate `foo/bar:v1.0.0`
- stages:
- name: manifest
image: cnbcool/manifest
settings:
# Docker username
username: docker-usernname
# Docker password
password: docker-password
# The multi-architecture image generated after merging
target: foo/bar:v1.0.0
# Template used to generate multi-architecture image names. The template combined with platforms generates the original image names for multi-architecture.
# In this example, the original image names are: foo/bar:v1.0.0-linux-amd64 and foo/bar:v1.0.0-linux-arm64, these two images must already exist
template: foo/bar:v1.0.0-OS-ARCH
# Multi-architecture platforms
platforms:
- linux/amd64
- linux/arm64
# Whether to skip TLS certificate verification, default is false
skipVerify: false
# Ignore missing source images, i.e., don't report an error if source images are missing, default is false
ignoreMissing: false
# Example 2: Image source is `docker.cnb.cool`, no need to provide username and password, the plugin will use the username and password from environment variables by default
# The following configuration will merge `docker.cnb.cool/foo/bar:v1.0.0-linux-amd64` and `docker.cnb.cool/foo/bar:v1.0.0-linux-arm64`,
# to generate `docker.cnb.cool/foo/bar:v1.0.0`
- stages:
- name: manifest
image: cnbcool/manifest
settings:
# The multi-architecture image generated after merging
target: docker.cnb.cool/foo/bar:v1.0.0
# Template used to generate multi-architecture image names. The template combined with platforms generates the original image names for multi-architecture.
# In this example, the original image names are: docker.cnb.cool/foo/bar:v1.0.0-linux-amd64 and docker.cnb.cool/foo/bar:v1.0.0-linux-arm64, these two images must already exist
template: docker.cnb.cool/foo/bar:v1.0.0-OS-ARCH
# Multi-architecture platforms
platforms:
- linux/amd64
- linux/arm64
# Whether to skip TLS certificate verification, default is false
skipVerify: false
# Ignore missing source images, i.e., don't report an error if source images are missing, default is false
ignoreMissing: false
# Example 3: Image source is `hub.docker.com`, generating multiple target multi-architecture images simultaneously
# The following configuration will merge `foo/bar:v1.0.0-linux-amd64` and `foo/bar:v1.0.0-linux-arm64`,
# to generate two versions of images: `foo/bar:v1.0.0` and `foo/bar:latest`, but in reality these two versions point to the same image
- stages:
- name: manifest
image: cnbcool/manifest
settings:
# Docker username
username: docker-usernname
# Docker password
password: docker-password
# The multi-architecture images generated after merging, supports generating multiple images simultaneously, separated by commas, e.g., foo/bar:v1.0.0,foo/bar:latest
target:
- foo/bar:v1.0.0
- foo/bar:latest
# Template used to generate multi-architecture image names. The template combined with platforms generates the original image names for multi-architecture.
# In this example, the original image names are: foo/bar:v1.0.0-linux-amd64 and foo/bar:v1.0.0-linux-arm64, these two images must already exist
template: foo/bar:v1.0.0-OS-ARCH
# Multi-architecture platforms
platforms:
- linux/amd64
- linux/arm64
# Whether to skip TLS certificate verification, default is false
skipVerify: false
# Ignore missing source images, i.e., don't report an error if source images are missing, default is false
ignoreMissing: false
With the above configuration, you can tag foo/bar as v1.0.0 on DockerHub, and v1.0.0 will be associated with these two tagged images on DockerHub. Note that the following two image tags must exist on DockerHub, i.e., they have been pushed:
When executing docker pull foo/bar:v1.0.0, it will pull the corresponding image based on the system architecture of the runtime environment.
username: Optional, Docker authentication username. When the target image source is CNB artifact repository, it uses the environment variable CNB_TOKEN_USER_NAME by default.password: Optional, Docker authentication password. When the target image source is CNB artifact repository, it uses the environment variable CNB_TOKEN by default.skipVerify: Optional, true or false, default is false, whether to skip TLS certificate verification.target: Required, target image name (the merged manifest will be pushed to this image name). Format: imagename:tag (imagename replaced with the image name, tag replaced with the tag name). Supports multiple targets, separated by commas. For example: foo/bar:v1.0.0 or foo/bar:latest,foo/bar:v1.0.0template: Required, template for associated image names. The OS and ARCH strings in the template will be replaced with specific system and architecture (system/architecture passed in platforms). For example: foo/bar:v1.0.0-OS-ARCH (you can replace foo/bar and v1.0.0 with your own image name and version number)platforms: Required, list of multi-architecture platforms, multiple entries can be separated by semicolons or passed in array form as shown in the examples above. Format is a list of system architectures in the form of OS/ARCH (system/architecture), which will generate a list of images to be associated with the target based on the template. For example: linux/amd64,linux/arm64.ignoreMissing: Optional, true or false, default is false, whether to ignore missing source images, i.e., don't report an error if multi-architecture images to be merged are missing. In the examples above, if either foo/bar:v1.0.0-linux-arm64 or foo/bar:v1.0.0-linux-amd64 is missing, it won't report an error. However, if both are missing, it will still report an error.