virtual-dsm/Dockerfile

74 lines
1.6 KiB
Docker
Raw Normal View History

2023-03-29 00:04:10 +00:00
FROM golang:1.20 AS builder
2023-03-26 23:22:25 +02:00
2023-03-27 23:04:42 +02:00
COPY serial/ /src/serial/
WORKDIR /src/serial
RUN go get -d -v golang.org/x/net/html
RUN go get -d -v github.com/gorilla/mux
2023-03-27 23:04:42 +02:00
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /src/serial/main .
2023-03-26 23:22:25 +02:00
FROM debian:bookworm-20230320-slim
2019-03-11 00:35:19 -07:00
RUN apt-get update && apt-get -y upgrade && \
apt-get --no-install-recommends -y install \
jq \
2023-04-02 08:28:31 +02:00
curl \
cpio \
wget \
unzip \
procps \
2023-04-02 21:37:31 +02:00
dnsmasq \
iptables \
iproute2 \
xz-utils \
btrfs-progs \
2023-04-02 21:37:31 +02:00
bridge-utils \
netcat-openbsd \
ca-certificates \
qemu-system-x86 \
2019-03-11 00:35:19 -07:00
&& apt-get clean
COPY run.sh /run/
2023-04-02 21:43:28 +02:00
COPY disk.sh /run/
2023-04-02 21:37:31 +02:00
COPY power.sh /run/
2023-04-02 21:43:28 +02:00
COPY serial.sh /run/
2023-03-27 19:21:49 +02:00
COPY server.sh /run/
2023-03-28 07:24:17 +02:00
COPY install.sh /run/
2023-04-02 17:55:25 +02:00
COPY network.sh /run/
2023-04-11 06:06:40 +02:00
COPY agent/agent.sh /agent/
COPY agent/service.sh /agent/
2023-03-27 23:04:42 +02:00
COPY --from=builder /src/serial/main /run/serial.bin
2019-03-11 00:35:19 -07:00
2023-03-26 20:29:21 +02:00
RUN ["chmod", "+x", "/run/run.sh"]
2023-04-02 21:37:31 +02:00
RUN ["chmod", "+x", "/run/disk.sh"]
RUN ["chmod", "+x", "/run/power.sh"]
2023-03-28 06:48:35 +02:00
RUN ["chmod", "+x", "/run/serial.sh"]
2023-03-27 19:21:49 +02:00
RUN ["chmod", "+x", "/run/server.sh"]
2023-03-28 07:24:17 +02:00
RUN ["chmod", "+x", "/run/install.sh"]
2023-04-02 17:55:25 +02:00
RUN ["chmod", "+x", "/run/network.sh"]
2023-04-01 20:13:17 +02:00
RUN ["chmod", "+x", "/run/serial.bin"]
2023-03-26 20:29:21 +02:00
2023-03-27 19:21:49 +02:00
COPY disks/template.img.xz /data/
2023-03-28 06:48:35 +02:00
VOLUME /storage
2019-03-11 00:35:19 -07:00
2023-03-28 06:48:35 +02:00
EXPOSE 22
EXPOSE 80
EXPOSE 139
EXPOSE 443
EXPOSE 445
2023-03-26 20:29:21 +02:00
EXPOSE 5000
EXPOSE 5001
2023-04-04 22:21:58 +02:00
ENV CPU_CORES 1
2023-04-11 06:06:40 +02:00
ENV DISK_SIZE 16G
ENV RAM_SIZE 512M
2023-03-27 22:25:47 +02:00
2023-04-01 20:20:39 +02:00
#ENV URL https://global.synologydownload.com/download/DSM/beta/7.2/64216/DSM_VirtualDSM_64216.pat
2023-03-27 22:25:47 +02:00
#ENV URL https://global.synologydownload.com/download/DSM/release/7.0.1/42218/DSM_VirtualDSM_42218.pat
2023-04-01 20:20:39 +02:00
ENV URL https://global.synologydownload.com/download/DSM/release/7.1.1/42962-1/DSM_VirtualDSM_42962.pat
2023-03-27 22:25:47 +02:00
2019-03-11 00:35:19 -07:00
ENTRYPOINT ["/run/run.sh"]