11FROM golang:1.19-alpine AS builder
22
3- RUN apk add --no-cache gcc musl-dev
3+ RUN apk add --no-cache gcc musl-dev libaio-dev
4+ RUN apk add --no-cache sanlock-dev --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing/
45
56WORKDIR /workspace
67
@@ -14,7 +15,8 @@ RUN --mount=type=cache,target=/root/.cache/go-build go build -a cmd/virt-prerunn
1415
1516FROM alpine
1617
17- RUN apk add --no-cache curl screen dnsmasq cdrkit iptables iproute2 qemu-virtiofsd dpkg util-linux s6-overlay nmap-ncat
18+ RUN apk add --no-cache curl screen dnsmasq cdrkit iptables iproute2 qemu-virtiofsd dpkg util-linux tini nmap-ncat
19+ RUN apk add --no-cache sanlock --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing/
1820
1921RUN set -eux; \
2022 mkdir /var/lib/cloud-hypervisor; \
@@ -34,19 +36,9 @@ RUN set -eux; \
3436 chmod +x /usr/bin/cloud-hypervisor; \
3537 chmod +x /usr/bin/ch-remote
3638
37- COPY build/virt-prerunner/cloud-hypervisor-type /etc/s6-overlay/s6-rc.d/cloud-hypervisor/type
38- COPY build/virt-prerunner/cloud-hypervisor-run.sh /etc/s6-overlay/s6-rc.d/cloud-hypervisor/run
39- COPY build/virt-prerunner/cloud-hypervisor-finish.sh /etc/s6-overlay/s6-rc.d/cloud-hypervisor/finish
40- RUN touch /etc/s6-overlay/s6-rc.d/user/contents.d/cloud-hypervisor
41-
4239COPY --from=builder /workspace/main /usr/bin/virt-prerunner
43- COPY build/virt-prerunner/virt-prerunner-type /etc/s6-overlay/s6-rc.d/virt-prerunner/type
44- COPY build/virt-prerunner/virt-prerunner-up /etc/s6-overlay/s6-rc.d/virt-prerunner/up
45- COPY build/virt-prerunner/virt-prerunner-run.sh /etc/s6-overlay/scripts/virt-prerunner-run.sh
46- RUN touch /etc/s6-overlay/s6-rc.d/user/contents.d/virt-prerunner
47- ENV S6_BEHAVIOUR_IF_STAGE2_FAILS=2
4840
49- ENTRYPOINT ["/init " ]
41+ ENTRYPOINT ["tini" , "-s" , "-g" , "--" , "/usr/bin/virt-prerunner " ]
5042
5143COPY build/virt-prerunner/iptables-wrapper /sbin/iptables-wrapper
5244RUN update-alternatives --install /sbin/iptables iptables /sbin/iptables-wrapper 100
0 commit comments