File size: 1,385 Bytes
c56af68
 
 
 
 
 
 
 
8912909
 
 
 
5f2bf75
 
26c5e65
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c56af68
 
8912909
 
 
 
 
 
 
c56af68
8912909
 
 
c56af68
8912909
 
 
 
bcd132b
 
c56af68
 
8912909
08138f9
c56af68
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
FROM scratch
COPY --from=qemux/qemu-docker:6.04 / /

ARG VERSION_ARG="0.0"
ARG DEBCONF_NOWARNINGS="yes"
ARG DEBIAN_FRONTEND="noninteractive"
ARG DEBCONF_NONINTERACTIVE_SEEN="true"

# 创建一个新用户并设置用户ID
RUN useradd -m -u 1000 user

# 切换到root用户执行需要root权限的命令
USER root

RUN set -eu && \
    apt-get update && \
    apt-get --no-install-recommends -y install \
        bc \
        curl \
        7zip \
        wsdd \
        samba \
        xz-utils \
        wimtools \
        dos2unix \
        cabextract \
        genisoimage \
        libxml2-utils && \
    apt-get clean && \
    echo "$VERSION_ARG" > /run/version && \
    rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# 切换到非root用户
USER user

# 设置环境变量和工作目录
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app

# 复制文件并设置所有者
COPY --chown=user ./src /run/
COPY --chown=user ./assets /run/assets

# 下载并设置文件权限
ADD --chown=user https://raw.githubusercontent.com/christgau/wsdd/v0.8/src/wsdd.py /usr/sbin/wsdd
ADD --chown=user https://github.com/qemus/virtiso-whql/releases/download/v1.9.43-0/virtio-win-1.9.43.tar.xz /drivers.txz

# 暴露端口和设置卷
EXPOSE 8006 3389
VOLUME /storage

# 设置环境变量
ENV RAM_SIZE="4G"
ENV CPU_CORES="2"
ENV DISK_SIZE="64G"
ENV VERSION="win11"