From 095c7c5498d64470d40072703bdaddca02cd089c Mon Sep 17 00:00:00 2001 From: Kroese Date: Wed, 26 Apr 2023 05:37:22 +0200 Subject: [PATCH] QEMU host --- Dockerfile | 49 +++++++++++++++++++++---------------------------- 1 file changed, 21 insertions(+), 28 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7d38aae..fd27a2f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,45 +1,38 @@ -FROM golang AS builder - -COPY serial/ /src/serial/ -WORKDIR /src/serial - -RUN go mod download -RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /src/serial/main . - +FROM qemux/qemu-host AS host FROM debian:bookworm-slim ARG DEBCONF_NOWARNINGS="yes" ARG DEBIAN_FRONTEND noninteractive RUN apt-get update && apt-get -y upgrade && \ - apt-get --no-install-recommends -y install \ - curl \ - cpio \ - wget \ - fdisk \ - unzip \ - procps \ - xz-utils \ - iptables \ - iproute2 \ - dnsmasq \ - net-tools \ - btrfs-progs \ - ca-certificates \ - isc-dhcp-client \ - netcat-openbsd \ - qemu-system-x86 \ + apt-get --no-install-recommends -y install \ + curl \ + cpio \ + wget \ + fdisk \ + unzip \ + procps \ + xz-utils \ + iptables \ + iproute2 \ + dnsmasq \ + net-tools \ + btrfs-progs \ + ca-certificates \ + isc-dhcp-client \ + netcat-openbsd \ + qemu-system-x86 \ && apt-get clean COPY run/*.sh /run/ COPY agent/*.sh /agent/ -COPY --from=builder /src/serial/main /run/serial.bin +COPY --from=host /qemu-host.bin /run/host.bin RUN ["chmod", "+x", "/run/run.sh"] RUN ["chmod", "+x", "/run/check.sh"] RUN ["chmod", "+x", "/run/server.sh"] -RUN ["chmod", "+x", "/run/serial.bin"] +RUN ["chmod", "+x", "/run/host.bin"] VOLUME /storage @@ -62,8 +55,8 @@ ENV VERSION=$VERSION_ARG LABEL org.opencontainers.image.created=${DATE_ARG} LABEL org.opencontainers.image.revision=${BUILD_ARG} LABEL org.opencontainers.image.version=${VERSION_ARG} -LABEL org.opencontainers.image.url=https://hub.docker.com/r/kroese/virtual-dsm/ LABEL org.opencontainers.image.source=https://github.com/kroese/virtual-dsm/ +LABEL org.opencontainers.image.url=https://hub.docker.com/r/kroese/virtual-dsm/ HEALTHCHECK --interval=30s --retries=1 CMD /run/check.sh