Files
skopeo/release
Yulia Gaponenko 39f8117c27 add multi-arch builds for upstream and stable skopeo image via Travis
Travis is used, as it has native hardware to run the build for many
architectures (amd64, s390x, ppc64le). Docker is used as build and
manifest tool. `quay.io/skopeo/upstream:master`, `quay.io/skopeo/stable:v1.2.0`
and `quay.io/containers/skopeo:v1.2.0` are specified as target multi-arch
upstream image.
Travis config file has 3 stages:
- local-build to do the local test for linux/amd64 and osx, as it was in
the initial code
- image-build-push to build and push images for specific architectures
(amd64, s390x, ppc64le)
- manifest-multiarch-push to create and push manifest for multi-arch
image - `quay.io/skopeo/upstream:master`, `quay.io/skopeo/stable:v1.2.0`
and `quay.io/containers/skopeo:v1.2.0`

last stage amnd image push step are not done for pull request.

2 env variables specified in Travis settings are expected - QUAY_USERNAME and
QUAY_PASSWORD to push the images to quay.io.
As a result multi-arch images for 3 architectures are published.

README about build setup id prepared

Signed-off-by: Yulia Gaponenko <yulia.gaponenko1@de.ibm.com>
2020-11-09 20:19:24 +01:00
..

skopeo container image build with Travis

This document describes the details and requirements to build and publish skopeo container images. The images are published as several architecture specific images and multiarch images on top for upstream and stable versions.

The Travis configuration is available at .travis.yml.

The code to build and publish images is available at release/Makefile and should be used only via Travis.

Travis workflow has 3 major pieces:

  • local-build - build and test source code locally on osx and linux/amd64 environments, 2 jobs are running in parallel
  • image-build-push - build and push container images with several Travis jobs running in parallel to build images for several architectures (linux/amd64, linux/s390x, linux/ppc64le). Build part is done for each PR, push part is executed only in case of cron job or master branch update.
  • manifest-multiarch-push - create and push image manifests, which consists of architecture specific images from previous step. Executed only in case of cron job or master branch update.

Ways to have full worklow run

  • cron job
  • Trigger build from Travis CI
  • Update code in master branch

Environment variables

Several environment variables are used to customize image names and keep private credentials to push to quay.io repositories.

Image tags are specified in environment variable and should be manually updated in case of new release.

  • QUAY_USERNAME and QUAY_PASSWORD are credentials to push image to corresponding quay.io repositories, should have write permissions. These variables should be specified in Travis.

Variables in .travis.yml

  • MULTIARCH_MANIFEST_ARCHITECTURES is a list with architecture shortnames, to apprear in final multiarch manifest. The values should fit to architectures used in the image-build-push Travis step.
  • STABLE_IMAGE, EXTRA_STABLE_IMAGE are image names to publish stable skopeo
  • UPSTREAM_IMAGE is image name to publish upstream skopeo

Values for environment variables

Env variable Value
MULTIARCH_MANIFEST_ARCHITECTURES "amd64 s390x ppc64le"
STABLE_IMAGE quay.io/skopeo/stable:v1.2.0
EXTRA_STABLE_IMAGE quay.io/containers/skopeo:v1.2.0
UPSTREAM_IMAGE quay.io/skopeo/upstream:master