QEMU host

This commit is contained in:
Kroese 2023-04-26 05:37:22 +02:00 committed by GitHub
parent 9d71bd3db2
commit 095c7c5498

View File

@ -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