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 FROM qemux/qemu-host AS host
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 debian:bookworm-slim FROM debian:bookworm-slim
ARG DEBCONF_NOWARNINGS="yes" ARG DEBCONF_NOWARNINGS="yes"
ARG DEBIAN_FRONTEND noninteractive ARG DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get -y upgrade && \ RUN apt-get update && apt-get -y upgrade && \
apt-get --no-install-recommends -y install \ apt-get --no-install-recommends -y install \
curl \ curl \
cpio \ cpio \
wget \ wget \
fdisk \ fdisk \
unzip \ unzip \
procps \ procps \
xz-utils \ xz-utils \
iptables \ iptables \
iproute2 \ iproute2 \
dnsmasq \ dnsmasq \
net-tools \ net-tools \
btrfs-progs \ btrfs-progs \
ca-certificates \ ca-certificates \
isc-dhcp-client \ isc-dhcp-client \
netcat-openbsd \ netcat-openbsd \
qemu-system-x86 \ qemu-system-x86 \
&& apt-get clean && apt-get clean
COPY run/*.sh /run/ COPY run/*.sh /run/
COPY agent/*.sh /agent/ 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/run.sh"]
RUN ["chmod", "+x", "/run/check.sh"] RUN ["chmod", "+x", "/run/check.sh"]
RUN ["chmod", "+x", "/run/server.sh"] RUN ["chmod", "+x", "/run/server.sh"]
RUN ["chmod", "+x", "/run/serial.bin"] RUN ["chmod", "+x", "/run/host.bin"]
VOLUME /storage VOLUME /storage
@ -62,8 +55,8 @@ ENV VERSION=$VERSION_ARG
LABEL org.opencontainers.image.created=${DATE_ARG} LABEL org.opencontainers.image.created=${DATE_ARG}
LABEL org.opencontainers.image.revision=${BUILD_ARG} LABEL org.opencontainers.image.revision=${BUILD_ARG}
LABEL org.opencontainers.image.version=${VERSION_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.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 HEALTHCHECK --interval=30s --retries=1 CMD /run/check.sh