virtual-dsm/Dockerfile

64 lines
1.6 KiB
Docker
Raw Normal View History

FROM qemux/qemu-host:2.05 as builder
2023-04-26 20:33:19 +02:00
2023-04-27 01:16:33 +02:00
# FROM golang as builder
# WORKDIR /
2024-01-04 05:31:34 +01:00
# RUN git clone https://github.com/qemus/qemu-host.git
2023-04-27 01:16:33 +02:00
# WORKDIR /qemu-host/src
# RUN go mod download
# RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /qemu-host.bin .
2023-04-26 20:33:19 +02:00
2023-10-17 19:05:22 +02:00
FROM debian:trixie-slim
2019-03-11 00:35:19 -07:00
2023-12-16 02:45:16 +01:00
ARG TARGETPLATFORM
2024-05-13 03:48:29 +02:00
ARG VERSION_ARG="0.0"
ARG DEBCONF_NOWARNINGS="yes"
ARG DEBIAN_FRONTEND="noninteractive"
ARG DEBCONF_NONINTERACTIVE_SEEN="true"
2023-04-23 20:20:47 +02:00
2024-05-13 04:02:25 +02:00
RUN set -eu && extra="" && \
2024-05-13 03:48:29 +02:00
if [ "$TARGETPLATFORM" != "linux/amd64" ]; then extra="qemu-user"; fi && \
2024-05-13 04:02:25 +02:00
apt-get update && \
2024-03-25 16:49:25 +01:00
apt-get --no-install-recommends -y install \
jq \
tini \
curl \
cpio \
wget \
fdisk \
unzip \
2024-01-20 19:59:44 +01:00
nginx \
procps \
xz-utils \
iptables \
iproute2 \
2024-01-10 17:58:50 +01:00
apt-utils \
dnsmasq \
2023-12-24 02:54:57 +01:00
fakeroot \
net-tools \
qemu-utils \
ca-certificates \
netcat-openbsd \
qemu-system-x86 \
2024-03-25 16:49:25 +01:00
"$extra" && \
apt-get clean && \
unlink /etc/nginx/sites-enabled/default && \
sed -i 's/^worker_processes.*/worker_processes 1;/' /etc/nginx/nginx.conf && \
2024-05-13 03:48:29 +02:00
echo "$VERSION_ARG" > /run/version && \
2024-03-25 16:49:25 +01:00
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
2024-05-13 03:48:29 +02:00
COPY --chmod=755 ./src /run/
COPY --chmod=755 ./web /var/www/
COPY --chmod=755 --from=builder /qemu-host.bin /run/host.bin
COPY --chmod=744 ./web/nginx.conf /etc/nginx/sites-enabled/web.conf
2023-03-26 20:29:21 +02:00
2023-03-28 06:48:35 +02:00
VOLUME /storage
2024-01-04 05:31:34 +01:00
EXPOSE 22 139 445 5000
2023-03-26 20:29:21 +02:00
2024-08-18 04:40:20 +02:00
ENV RAM_SIZE="1G"
ENV DISK_SIZE="16G"
ENV CPU_CORES="1"
2023-03-27 22:25:47 +02:00
2023-11-20 11:45:28 +01:00
HEALTHCHECK --interval=60s --start-period=45s --retries=2 CMD /run/check.sh
2023-04-16 17:27:50 +02:00
ENTRYPOINT ["/usr/bin/tini", "-s", "/run/entry.sh"]