mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-23 05:58:04 +00:00
build: Set safe.directory for runtime repo
While doing a docker build for shim-v2, we see this: ``` fatal: unsafe repository ('/home/${user}/go/src/github.com/kata-containers/kata-containers' is owned by someone else) To add an exception for this directory, call: git config --global --add safe.directory /home/${user}/go/src/github.com/kata-containers/kata-containers ``` This is because the docker container build is run as root while the runtime repo is checked out as normal user. Unlike this error causing the rootfs build to error out, the error here does not really cause `make shim-v2-tarball` to fail. However its good to get rid of this error message showing during the make process. Fixes: #4572 Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
This commit is contained in:
parent
c29038a2e2
commit
4e48509ed9
@ -29,12 +29,12 @@ fi
|
|||||||
sudo docker run --rm -i -v "${repo_root_dir}:${repo_root_dir}" \
|
sudo docker run --rm -i -v "${repo_root_dir}:${repo_root_dir}" \
|
||||||
-w "${repo_root_dir}/src/runtime" \
|
-w "${repo_root_dir}/src/runtime" \
|
||||||
"${container_image}" \
|
"${container_image}" \
|
||||||
bash -c "make PREFIX=${PREFIX} QEMUCMD=qemu-system-${arch}"
|
bash -c "git config --global --add safe.directory ${repo_root_dir} && make PREFIX=${PREFIX} QEMUCMD=qemu-system-${arch}"
|
||||||
|
|
||||||
sudo docker run --rm -i -v "${repo_root_dir}:${repo_root_dir}" \
|
sudo docker run --rm -i -v "${repo_root_dir}:${repo_root_dir}" \
|
||||||
-w "${repo_root_dir}/src/runtime" \
|
-w "${repo_root_dir}/src/runtime" \
|
||||||
"${container_image}" \
|
"${container_image}" \
|
||||||
bash -c "make PREFIX="${PREFIX}" DESTDIR="${DESTDIR}" install"
|
bash -c "git config --global --add safe.directory ${repo_root_dir} && make PREFIX="${PREFIX}" DESTDIR="${DESTDIR}" install"
|
||||||
|
|
||||||
sudo sed -i -e '/^initrd =/d' "${DESTDIR}/${PREFIX}/share/defaults/kata-containers/configuration-qemu.toml"
|
sudo sed -i -e '/^initrd =/d' "${DESTDIR}/${PREFIX}/share/defaults/kata-containers/configuration-qemu.toml"
|
||||||
sudo sed -i -e '/^initrd =/d' "${DESTDIR}/${PREFIX}/share/defaults/kata-containers/configuration-fc.toml"
|
sudo sed -i -e '/^initrd =/d' "${DESTDIR}/${PREFIX}/share/defaults/kata-containers/configuration-fc.toml"
|
||||||
|
Loading…
Reference in New Issue
Block a user