mirror of
https://github.com/aljazceru/kata-containers.git
synced 2026-01-31 04:04:24 +01:00
git-subtree-dir: tools/packaging git-subtree-mainline:f818b46a41git-subtree-split:1f22d72d5dSigned-off-by: Peng Tao <bergwolf@hyper.sh>
67 lines
1.5 KiB
Docker
67 lines
1.5 KiB
Docker
from ubuntu:20.04
|
|
|
|
ARG QEMU_REPO
|
|
# commit/tag/branch
|
|
ARG QEMU_VERSION
|
|
ARG QEMU_TARBALL
|
|
ARG PREFIX
|
|
|
|
WORKDIR /root/qemu
|
|
RUN apt-get update && apt-get upgrade -y
|
|
RUN apt-get --no-install-recommends install -y \
|
|
apt-utils \
|
|
autoconf \
|
|
automake \
|
|
bc \
|
|
bison \
|
|
ca-certificates \
|
|
cpio \
|
|
flex \
|
|
gawk \
|
|
libaudit-dev \
|
|
libblkid-dev \
|
|
libcap-dev \
|
|
libcap-ng-dev \
|
|
libdw-dev \
|
|
libelf-dev \
|
|
libffi-dev \
|
|
libglib2.0-0 \
|
|
libglib2.0-dev \
|
|
libglib2.0-dev git \
|
|
libltdl-dev \
|
|
libmount-dev \
|
|
libpixman-1-dev \
|
|
libpmem-dev \
|
|
libselinux1-dev \
|
|
libtool \
|
|
make \
|
|
pkg-config \
|
|
pkg-config \
|
|
python \
|
|
python-dev \
|
|
rsync \
|
|
zlib1g-dev
|
|
|
|
RUN cd .. && git clone "${QEMU_REPO}" qemu
|
|
RUN git checkout "${QEMU_VERSION}"
|
|
RUN git clone https://github.com/qemu/capstone.git capstone
|
|
RUN git clone https://github.com/qemu/keycodemapdb.git ui/keycodemapdb
|
|
|
|
ADD scripts/configure-hypervisor.sh /root/configure-hypervisor.sh
|
|
ADD qemu/patches/ /root/kata_qemu_patches
|
|
|
|
RUN \
|
|
cat VERSION; \
|
|
stable_branch=$(cat VERSION | awk 'BEGIN{FS=OFS="."}{print $1 "." $2 ".x"}');\
|
|
for patch in $(find /root/kata_qemu_patches/${stable_branch}/ -name '*.patch'); do\
|
|
echo "apply $patch";\
|
|
git apply "$patch"; \
|
|
done
|
|
|
|
RUN PREFIX="${PREFIX}" /root/configure-hypervisor.sh -s kata-qemu | xargs ./configure \
|
|
--with-pkgversion=kata-static
|
|
|
|
RUN make -j$(nproc)
|
|
RUN make install DESTDIR=/tmp/qemu-static
|
|
RUN cd /tmp/qemu-static && tar -czvf "${QEMU_TARBALL}" *
|