mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-27 07:48:55 +00:00
kata-deploy: Allow passing BASE_IMAGE_{NAME,TAG}
Let's break the IMAGE build parameter into BASE_IMAGE_NAME and BASE_IMAGE_TAG, as it makes it easier to replace the default CentOS image by something else. Spoiler alert, the default CentOS image is **not** multi-arch, and we do want to support at least aarch64 and s390x in the near term future. Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
parent
ebe916b372
commit
6267909501
@ -3,8 +3,9 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
# Specify alternative base image, e.g. clefos for s390x
|
||||
ARG IMAGE
|
||||
FROM ${IMAGE:-registry.centos.org/centos}:7
|
||||
ARG BASE_IMAGE_NAME=registry.centos.org/centos
|
||||
ARG BASE_IMAGE_TAG=7
|
||||
FROM $BASE_IMAGE_NAME:$BASE_IMAGE_TAG
|
||||
ARG KATA_ARTIFACTS=./kata-static.tar.xz
|
||||
ARG DESTINATION=/opt/kata-artifacts
|
||||
|
||||
|
@ -20,8 +20,8 @@ IMAGE_TAG="${REGISTRY}:kata-containers-$(git rev-parse HEAD)-$(uname -m)"
|
||||
echo "Building the image"
|
||||
if [ "$(uname -m)" = "s390x" ]; then
|
||||
docker build \
|
||||
--build-arg IMG_NAME=clefos \
|
||||
--build-arg IMG_TAG=7 \
|
||||
--build-arg BASE_IMAGE_NAME=clefos \
|
||||
--build-arg BASE_IMAGE_TAG=7 \
|
||||
--tag ${IMAGE_TAG} .
|
||||
else
|
||||
docker build --tag ${IMAGE_TAG} .
|
||||
@ -36,8 +36,8 @@ if [ -n "${TAG}" ]; then
|
||||
echo "Building the ${ADDITIONAL_TAG} image"
|
||||
if [ "$(uname -m)" = "s390x" ]; then
|
||||
docker build \
|
||||
--build-arg IMG_NAME=clefos \
|
||||
--build-arg IMG_TAG=7 \
|
||||
--build-arg BASE_IMAGE_NAME=clefos \
|
||||
--build-arg BASE_IMAGE_TAG=7 \
|
||||
--tag ${ADDITIONAL_TAG} .
|
||||
else
|
||||
docker build --tag ${ADDITIONAL_TAG} .
|
||||
|
Loading…
Reference in New Issue
Block a user