arv-v-dsm/Dockerfile

66 lines
1.6 KiB
Docker
Raw Normal View History

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