kas-container: add support to set a custom container images location

There are situation that the user have a local customized container images
with tools installed that are not provided in the default kas container.

- For a local container the user can tag it and use the existing variables:

 docker tag local-container my/container:1.0
 export KAS_CONTAINER_IMAGE_PATH=my
 export KAS_CONTAINER_IMAGE_NAME=container
 export KAS_IMAGE_VERSION=1.0

- This patch improve the user interface by allowing to set a custom image
 with just a single environment variable.

 export KAS_CONTAINER_IMAGE=local-container

Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Jose Quaresma 2021-04-16 14:09:02 +02:00 committed by Jan Kiszka
parent 06240c23da
commit 6e82e0d12d

View File

@ -88,7 +88,8 @@ set_container_image_var() {
KAS_IMAGE_VERSION="${KAS_IMAGE_VERSION:-${KAS_IMAGE_VERSION_DEFAULT}}"
KAS_CONTAINER_IMAGE_NAME="${KAS_CONTAINER_IMAGE_NAME:-${KAS_CONTAINER_IMAGE_NAME_DEFAULT}}"
KAS_CONTAINER_IMAGE_PATH="${KAS_CONTAINER_IMAGE_PATH:-${KAS_CONTAINER_IMAGE_PATH_DEFAULT}}"
KAS_CONTAINER_IMAGE="${KAS_CONTAINER_IMAGE_PATH}/${KAS_CONTAINER_IMAGE_NAME}:${KAS_IMAGE_VERSION}"
KAS_CONTAINER_IMAGE_DEFAULT="${KAS_CONTAINER_IMAGE_PATH}/${KAS_CONTAINER_IMAGE_NAME}:${KAS_IMAGE_VERSION}"
KAS_CONTAINER_IMAGE="${KAS_CONTAINER_IMAGE:-${KAS_CONTAINER_IMAGE_DEFAULT}}"
}
KAS_WORK_DIR=$(readlink -f "${KAS_WORK_DIR:-$(pwd)}")