mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-25 06:52:13 +00:00
packaging/qemu: Add QEMU_DESTDIR argument to dockerfiles
The dockerfiles used to build qemu and qemu-virtiofs have the QEMU destination path hardcoded, which in turn is also on the build scripts. This refactor the dockerfiles to add the QEMU_DESTDIR argument, which value is passed by the scripts. Fixes #1168 Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
This commit is contained in:
parent
e167bf30e3
commit
4c3377de3b
@ -4,6 +4,7 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
from ubuntu:20.04
|
||||
|
||||
ARG QEMU_DESTDIR
|
||||
ARG QEMU_VIRTIOFS_REPO
|
||||
# commit/tag/branch
|
||||
ARG QEMU_VIRTIOFS_TAG
|
||||
@ -69,7 +70,8 @@ RUN PREFIX="${PREFIX}" /root/configure-hypervisor.sh -s kata-qemu | sed -e 's|--
|
||||
|
||||
RUN make -j$(nproc)
|
||||
RUN make -j$(nproc) virtiofsd
|
||||
RUN make install DESTDIR=/tmp/qemu-virtiofs-static
|
||||
RUN mv /tmp/qemu-virtiofs-static/"${PREFIX}"/bin/qemu-system-x86_64 /tmp/qemu-virtiofs-static/"${PREFIX}"/bin/qemu-virtiofs-system-x86_64
|
||||
RUN mv /tmp/qemu-virtiofs-static/"${PREFIX}"/libexec/kata-qemu/virtiofsd /tmp/qemu-virtiofs-static/opt/kata/bin/virtiofsd-dax
|
||||
RUN cd /tmp/qemu-virtiofs-static && tar -czvf "${QEMU_TARBALL}" *
|
||||
RUN make install DESTDIR="${QEMU_DESTDIR}"
|
||||
RUN cd "${QEMU_DESTDIR}/${PREFIX}" && \
|
||||
mv bin/qemu-system-x86_64 bin/qemu-virtiofs-system-x86_64 && \
|
||||
mv libexec/kata-qemu/virtiofsd bin/virtiofsd-dax
|
||||
RUN cd "${QEMU_DESTDIR}" && tar -czvf "${QEMU_TARBALL}" *
|
||||
|
@ -26,6 +26,7 @@ qemu_virtiofs_repo=$(get_from_kata_deps "assets.hypervisor.qemu-experimental.url
|
||||
qemu_virtiofs_tag=$(get_from_kata_deps "assets.hypervisor.qemu-experimental.tag" "${kata_version}")
|
||||
qemu_virtiofs_tar="kata-static-qemu-virtiofsd.tar.gz"
|
||||
qemu_tmp_tar="kata-static-qemu-virtiofsd-tmp.tar.gz"
|
||||
qemu_destdir="/tmp/qemu-virtiofs-static"
|
||||
|
||||
info "Build ${qemu_virtiofs_repo} tag: ${qemu_virtiofs_tag}"
|
||||
|
||||
@ -37,6 +38,7 @@ sudo "${DOCKER_CLI}" build \
|
||||
--no-cache \
|
||||
--build-arg http_proxy="${http_proxy}" \
|
||||
--build-arg https_proxy="${https_proxy}" \
|
||||
--build-arg QEMU_DESTDIR="${qemu_destdir}" \
|
||||
--build-arg QEMU_VIRTIOFS_REPO="${qemu_virtiofs_repo}" \
|
||||
--build-arg QEMU_VIRTIOFS_TAG="${qemu_virtiofs_tag}" \
|
||||
--build-arg QEMU_TARBALL="${qemu_virtiofs_tar}" \
|
||||
@ -48,7 +50,7 @@ sudo "${DOCKER_CLI}" build \
|
||||
sudo "${DOCKER_CLI}" run \
|
||||
-i \
|
||||
-v "${PWD}":/share qemu-virtiofs-static \
|
||||
mv "/tmp/qemu-virtiofs-static/${qemu_virtiofs_tar}" /share/
|
||||
mv "${qemu_destdir}/${qemu_virtiofs_tar}" /share/
|
||||
|
||||
sudo chown ${USER}:${USER} "${PWD}/${qemu_virtiofs_tar}"
|
||||
|
||||
|
@ -4,6 +4,7 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
from ubuntu:20.04
|
||||
|
||||
ARG QEMU_DESTDIR
|
||||
ARG QEMU_REPO
|
||||
# commit/tag/branch
|
||||
ARG QEMU_VERSION
|
||||
@ -64,5 +65,5 @@ RUN PREFIX="${PREFIX}" /root/configure-hypervisor.sh -s kata-qemu | xargs ./conf
|
||||
|
||||
RUN make -j$(nproc)
|
||||
RUN make -j$(nproc) virtiofsd
|
||||
RUN make install DESTDIR=/tmp/qemu-static
|
||||
RUN cd /tmp/qemu-static && tar -czvf "${QEMU_TARBALL}" *
|
||||
RUN make install DESTDIR="${QEMU_DESTDIR}"
|
||||
RUN cd "${QEMU_DESTDIR}" && tar -czvf "${QEMU_TARBALL}" *
|
||||
|
@ -16,6 +16,7 @@ source "${script_dir}/../qemu.blacklist"
|
||||
packaging_dir="${script_dir}/../.."
|
||||
qemu_tar="kata-static-qemu.tar.gz"
|
||||
qemu_tmp_tar="kata-static-qemu-tmp.tar.gz"
|
||||
qemu_destdir="/tmp/qemu-static/"
|
||||
|
||||
qemu_repo="${qemu_repo:-}"
|
||||
qemu_version="${qemu_version:-}"
|
||||
@ -45,6 +46,7 @@ sudo docker build \
|
||||
--no-cache \
|
||||
--build-arg http_proxy="${http_proxy}" \
|
||||
--build-arg https_proxy="${https_proxy}" \
|
||||
--build-arg QEMU_DESTDIR="${qemu_destdir}" \
|
||||
--build-arg QEMU_REPO="${qemu_repo}" \
|
||||
--build-arg QEMU_VERSION="${qemu_version}" \
|
||||
--build-arg QEMU_TARBALL="${qemu_tar}" \
|
||||
@ -56,7 +58,7 @@ sudo docker build \
|
||||
sudo docker run \
|
||||
-i \
|
||||
-v "${PWD}":/share qemu-static \
|
||||
mv "/tmp/qemu-static/${qemu_tar}" /share/
|
||||
mv "${qemu_destdir}/${qemu_tar}" /share/
|
||||
|
||||
sudo chown ${USER}:${USER} "${PWD}/${qemu_tar}"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user