mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-05 19:47:53 +00:00
image-builder: share the mkfs configuration file
Share with the container the mkfs configuration file to use only the filesystem features supported in the host. fixes #270 Signed-off-by: Julio Montes <julio.montes@intel.com>
This commit is contained in:
parent
a17d2bbb40
commit
88b85231ca
@ -99,6 +99,7 @@ build_with_docker() {
|
|||||||
local agent_bin="$6"
|
local agent_bin="$6"
|
||||||
local agent_init="$7"
|
local agent_init="$7"
|
||||||
local docker_image_name="image-builder-osbuilder"
|
local docker_image_name="image-builder-osbuilder"
|
||||||
|
local shared_files=""
|
||||||
|
|
||||||
image_dir=$(readlink -f "$(dirname "${image}")")
|
image_dir=$(readlink -f "$(dirname "${image}")")
|
||||||
image_name=$(basename "${image}")
|
image_name=$(basename "${image}")
|
||||||
@ -108,6 +109,11 @@ build_with_docker() {
|
|||||||
--build-arg https_proxy="${https_proxy}" \
|
--build-arg https_proxy="${https_proxy}" \
|
||||||
-t "${docker_image_name}" "${script_dir}"
|
-t "${docker_image_name}" "${script_dir}"
|
||||||
|
|
||||||
|
readonly mke2fs_conf="/etc/mke2fs.conf"
|
||||||
|
if [ -f "${mke2fs_conf}" ]; then
|
||||||
|
shared_files+="-v ${mke2fs_conf}:${mke2fs_conf}:ro "
|
||||||
|
fi
|
||||||
|
|
||||||
#Make sure we use a compatible runtime to build rootfs
|
#Make sure we use a compatible runtime to build rootfs
|
||||||
# In case Clear Containers Runtime is installed we dont want to hit issue:
|
# In case Clear Containers Runtime is installed we dont want to hit issue:
|
||||||
#https://github.com/clearcontainers/runtime/issues/828
|
#https://github.com/clearcontainers/runtime/issues/828
|
||||||
@ -126,6 +132,7 @@ build_with_docker() {
|
|||||||
-v "${script_dir}/../scripts":"/scripts" \
|
-v "${script_dir}/../scripts":"/scripts" \
|
||||||
-v "${rootfs}":"/rootfs" \
|
-v "${rootfs}":"/rootfs" \
|
||||||
-v "${image_dir}":"/image" \
|
-v "${image_dir}":"/image" \
|
||||||
|
${shared_files} \
|
||||||
${docker_image_name} \
|
${docker_image_name} \
|
||||||
bash "/osbuilder/${script_name}" -o "/image/${image_name}" /rootfs
|
bash "/osbuilder/${script_name}" -o "/image/${image_name}" /rootfs
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user