-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
88 lines (85 loc) · 3.35 KB
/
Copy pathDockerfile
File metadata and controls
88 lines (85 loc) · 3.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# syntax=docker/dockerfile:1.27@sha256:bde3983e9c939224420ddaf6b784cc30e09b035a4dea01f581230c50809f372e
# SPDX-FileCopyrightText: © 2025 VEXXHOST, Inc.
# SPDX-License-Identifier: GPL-3.0-or-later
ARG FROM=ghcr.io/vexxhost/ubuntu-cloud-archive:main@sha256:8ecef42d4bdd95bafa380b459b895cb50cb361dc854dda1c74484ae8f1e6d395
FROM ${FROM} AS qemu-builder
ARG TARGETARCH
ARG QEMU_COMMIT=c509d34e5d97b1949b8daafbb53afdd036c2195d
ARG QEMU_PACKAGE_VERSION=1:8.2.2+ds-0ubuntu1.18+vexxhost2
RUN if [ "${TARGETARCH}" = amd64 ]; then \
apt-get update && \
apt-get install --no-install-recommends -y \
build-essential \
devscripts \
equivs \
git \
quilt; \
fi
WORKDIR /src/qemu
RUN if [ "${TARGETARCH}" = amd64 ]; then \
git init && \
git remote add origin https://git.launchpad.net/ubuntu/+source/qemu && \
git fetch --depth=1 origin ${QEMU_COMMIT} && \
git checkout --detach FETCH_HEAD && \
mk-build-deps \
--build-dep \
--install \
--remove \
--tool 'apt-get -y --no-install-recommends' \
debian/control; \
fi
COPY patches/qemu /patches/qemu
COPY hack/build-qemu /usr/local/bin/build-qemu
RUN --network=none if [ "${TARGETARCH}" = amd64 ]; then \
QEMU_PACKAGE_VERSION=${QEMU_PACKAGE_VERSION} build-qemu; \
else \
mkdir /out; \
fi
FROM ${FROM}
ARG TARGETARCH
ARG QEMU_PACKAGE_VERSION=1:8.2.2+ds-0ubuntu1.18+vexxhost2
RUN groupadd -g 42424 nova && \
useradd -u 42424 -g 42424 -M -d /var/lib/nova -s /usr/sbin/nologin -c "Nova User" nova && \
mkdir -p /etc/nova /var/log/nova /var/lib/nova /var/cache/nova && \
chown -Rv nova:nova /etc/nova /var/log/nova /var/lib/nova /var/cache/nova
RUN --mount=type=bind,from=qemu-builder,source=/out,target=/qemu-debs,ro \
if [ "${TARGETARCH}" = amd64 ]; then QEMU_DEBS=/qemu-debs/*.deb; fi && \
apt-get update -qq && \
apt-get install -qq -y --no-install-recommends \
apparmor \
ceph-common \
cgroup-tools \
dmidecode \
ebtables \
iproute2 \
ipxe-qemu \
ipxe-qemu-256k-compat-efi-roms \
kmod \
libtpms0 \
libvirt-clients \
libvirt-daemon-system \
mdevctl \
openssh-client \
openvswitch-switch \
ovmf \
pm-utils \
qemu-block-extra \
qemu-efi-aarch64 \
qemu-kvm \
seabios \
swtpm \
swtpm-tools \
${QEMU_DEBS} && \
if [ "${TARGETARCH}" = amd64 ]; then \
test "$(dpkg-query -W -f='${Version}' qemu-block-extra)" = "${QEMU_PACKAGE_VERSION}" && \
test "$(dpkg-query -W -f='${Version}' qemu-system-common)" = "${QEMU_PACKAGE_VERSION}" && \
test "$(dpkg-query -W -f='${Version}' qemu-system-x86)" = "${QEMU_PACKAGE_VERSION}" && \
RBD_PROBE_OUTPUT="$(timeout 5 qemu-system-x86_64 -display none -nodefaults \
-blockdev '{"driver":"rbd","pool":"__probe__","image":"__probe__","server":[{"host":"127.0.0.1","port":"1"}],"node-name":"rbd-probe"}' 2>&1 || true)" && \
if printf '%s\n' "${RBD_PROBE_OUTPUT}" | grep -Eq "Unable to load block driver rbd|Unknown driver 'rbd'"; then \
printf '%s\n' "${RBD_PROBE_OUTPUT}" >&2; \
exit 1; \
fi; \
fi && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*