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:
Julio Montes 2019-04-01 09:18:28 -06:00
parent a17d2bbb40
commit 88b85231ca

View File

@ -99,6 +99,7 @@ build_with_docker() {
local agent_bin="$6"
local agent_init="$7"
local docker_image_name="image-builder-osbuilder"
local shared_files=""
image_dir=$(readlink -f "$(dirname "${image}")")
image_name=$(basename "${image}")
@ -108,6 +109,11 @@ build_with_docker() {
--build-arg https_proxy="${https_proxy}" \
-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
# In case Clear Containers Runtime is installed we dont want to hit issue:
#https://github.com/clearcontainers/runtime/issues/828
@ -126,6 +132,7 @@ build_with_docker() {
-v "${script_dir}/../scripts":"/scripts" \
-v "${rootfs}":"/rootfs" \
-v "${image_dir}":"/image" \
${shared_files} \
${docker_image_name} \
bash "/osbuilder/${script_name}" -o "/image/${image_name}" /rootfs
}