rootfs-builder: add rootfs.sh DOCKER_RUNTIME env var

On some systems the "runc" runtime isn't available or has a different
name.  Allow the user to override the Docker runtime.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Fixes: #268
This commit is contained in:
Stefan Hajnoczi 2019-03-28 13:59:15 +00:00 committed by Stefan Hajnoczi
parent 20b087e3d2
commit c72c95496e

View File

@ -16,6 +16,7 @@ AGENT_BIN=${AGENT_BIN:-kata-agent}
AGENT_INIT=${AGENT_INIT:-no} AGENT_INIT=${AGENT_INIT:-no}
KERNEL_MODULES_DIR=${KERNEL_MODULES_DIR:-""} KERNEL_MODULES_DIR=${KERNEL_MODULES_DIR:-""}
OSBUILDER_VERSION="unknown" OSBUILDER_VERSION="unknown"
DOCKER_RUNTIME=${DOCKER_RUNTIME:-runc}
export GOPATH=${GOPATH:-${HOME}/go} export GOPATH=${GOPATH:-${HOME}/go}
lib_file="${script_dir}/../scripts/lib.sh" lib_file="${script_dir}/../scripts/lib.sh"
@ -103,6 +104,9 @@ USE_DOCKER If set, build the rootfs inside a container (requires
Docker). Docker).
Default value: <not set> Default value: <not set>
DOCKER_RUNTIME Docker runtime to use when USE_DOCKER is set.
Default value: runc
Refer to the Platform-OS Compatibility Matrix for more details on the supported Refer to the Platform-OS Compatibility Matrix for more details on the supported
architectures: architectures:
https://github.com/kata-containers/osbuilder#platform-distro-compatibility-matrix https://github.com/kata-containers/osbuilder#platform-distro-compatibility-matrix
@ -319,7 +323,7 @@ if [ -n "${USE_DOCKER}" ] ; then
docker_run_args="" docker_run_args=""
docker_run_args+=" --rm" docker_run_args+=" --rm"
docker_run_args+=" --runtime runc" docker_run_args+=" --runtime ${DOCKER_RUNTIME}"
if [ -z "${AGENT_SOURCE_BIN}" ] ; then if [ -z "${AGENT_SOURCE_BIN}" ] ; then
docker_run_args+=" --env GO_AGENT_PKG=${GO_AGENT_PKG}" docker_run_args+=" --env GO_AGENT_PKG=${GO_AGENT_PKG}"