wkplhc commited on
Commit
84254dc
1 Parent(s): a802c33

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -13
Dockerfile CHANGED
@@ -56,16 +56,20 @@ ENV CPU_CORES="2"
56
  ENV DISK_SIZE="64G"
57
  ENV VERSION="win11"
58
 
59
- # 启动 QEMU 并绑定到 0.0.0.0:7860
60
- CMD ["qemu-system-x86_64", \
61
- "-hda", "/run/disk.img", \
62
- "-m", "${RAM_SIZE}", \
63
- "-smp", "${CPU_CORES}", \
64
- "-vnc", "0.0.0.0:7860", \
65
- "-usb", \
66
- "-device", "usb-tablet", \
67
- "-net", "nic", \
68
- "-net", "user", \
69
- "-device", "virtio-net", \
70
- "-boot", "order=d", \
71
- "-display", "none"]
 
 
 
 
 
56
  ENV DISK_SIZE="64G"
57
  ENV VERSION="win11"
58
 
59
+ # 创建启动脚本并设置执行权限
60
+ RUN echo '#!/bin/bash\n\
61
+ qemu-system-x86_64 \\\n\
62
+ -hda /run/disk.img \\\n\
63
+ -m ${RAM_SIZE} \\\n\
64
+ -smp ${CPU_CORES} \\\n\
65
+ -vnc 0.0.0.0:7860 \\\n\
66
+ -usb \\\n\
67
+ -device usb-tablet \\\n\
68
+ -net nic \\\n\
69
+ -net user \\\n\
70
+ -device virtio-net \\\n\
71
+ -boot order=d \\\n\
72
+ -display none' > /home/user/start.sh && chmod +x /home/user/start.sh
73
+
74
+ # 使用启动脚本启动 QEMU
75
+ CMD ["/bin/bash", "/home/user/start.sh"]