deckhand/doc/source/operators/multi-distro-support.rst
Arun Kant 8eb74b0509 Adding opensuse image build for deckhand
Adding DISTRO parameter for makefile to invoke distribution specific
Dockerfile and build image accordingly.

Updated logic for existing jobs to have distro specific logic
for building and publishing images.

Added multiple distro specific document in operator section.

Change-Id: I415ab28b06ea17b21e76d28ccb3e284041c8072d
2019-05-30 17:22:57 +00:00

3.3 KiB

Multiple Distro Support

This project builds images for Deckhand component only. Currently, it supports building images for ubuntu and opensuse ( leap 15.0 as base image).

By default, Ubuntu images are built and are published to public registry server. Recently support for publishing opensuse image has been added.

If you need to build opensuse images locally, the following parameters can be passed to the make command in deckhand repository's root directory with images as target:

DISTRO: opensuse_15
DISTRO_BASE_IMAGE: "opensuse/leap:15.0"
DOCKER_REGISTRY: { your_docker_registry }
IMAGE_TAG: latest
PUSH_IMAGE: false

Following is an example in command format to build and publish images locally. Command is run in deckhand repository's root directory.

make images DISTRO=opensuse_15 DOCKER_REGISTRY={ your_docker_registry} IMAGE_TAG=latest PUSH_IMAGE=true

Following parameters need to be passed as environment/shell variable to make command:

DISTRO

parameter to identify distro specific Dockerfile, ubuntu_xenial (Default)

DISTRO_BASE_IMAGE

parameter to use different base image other than what's used in DISTRO specific Dockerfile (optional)

DOCKER_REGISTRY

parameter to specify local/internal docker registry if need to publish image (optional), quay.io (Default)

IMAGE_TAG

tag to be used for image built, untagged (Default)

PUSH_IMAGE

flag to indicate if images needs to be pushed to a docker registry, false (Default)

This work is done as per approved spec multi_distro_support. Currently only image building logic is enhanced to support multiple distro.

Adding New Distro Support

To add support for building images for a new distro, following steps can be followed.

  1. Distro specific deckhand image can be built and tested locally first.
  2. Add distro specific Dockerfile which will have steps to include necessary packages and run environment configuration. Use existing Dockerfile as sample to identify needed packages and environment information.
  3. New dockerfile can be named as Dockefile.{DISTRO} where DISTRO is expected to be distro identifier which is passed to makefile.
  4. Respective dockerfile needs to be placed in {deckahnd_repo}/images/deckhand/
  5. Add check, gate, and post jobs for building, testing and publishing images. These entries need to be added in {deckhand_repo}/.zuul.yaml file. You may refer to existing zuul file to opensuse support to understand its usage pattern.
  6. Add any relevant information to this document.