在ubuntu 建置docker及compose
安裝KVM
sudo apt install cpu-checker -y
執行 sudo kvm-ok
順利的話出現
INFO: /dev/kvm exists
KVM acceleration can be used
1.下載windows鏡像
docker pull dockurr/windows
也可以選擇本地構建:
git clone https://github.com/dockur/windows.git
cd windows
docker build -t dockurr/windows .
2.建立docker-compose.yml
#version: "3" --目前新版本已不適用
services:
windows:
image: dockurr/windows
container_name: windows
privileged: true
environment:
VERSION: "win11"
BOOT_MODE: "windows_plain"
devices:
- /dev/kvm
cap_add:
- NET_ADMIN
ports:
- 8006:8006
- 3389:3389/tcp
- 3389:3389/udp
stop_grace_period: 2m
restart: on-failure
network_mode: bridge
3.執行docker compose up
4.用瀏覽器連 docker主機IP:8006
Value | Description | Source | Transfer | Size |
---|
win11 | Windows 11 Pro | Microsoft | Fast | 6.4 GB | win10 | Windows 10 Pro | Microsoft | Fast | 5.8 GB | ltsc10 | Windows 10 LTSC | Microsoft | Fast | 4.6 GB | win81 | Windows 8.1 Pro | Microsoft | Fast | 4.2 GB | win7 | Windows 7 SP1 | Bob Pony | Medium | 3.0 GB | vista | Windows Vista SP2 | Bob Pony | Medium | 3.6 GB | winxp | Windows XP SP3 | Bob Pony | Medium | 0.6 GB | | | | | | 2022 | Windows Server 2022 | Microsoft | Fast | 4.7 GB | 2019 | Windows Server 2019 | Microsoft | Fast | 5.3 GB | 2016 | Windows Server 2016 | Microsoft | Fast | 6.5 GB | 2012 | Windows Server 2012 R2 | Microsoft | Fast | 4.3 GB | 2008 | Windows Server 2008 R2 | Microsoft | Fast | 3.0 GB | | | | | | core11 | Tiny 11 Core | Archive.org | Slow | 2.1 GB | tiny11 | Tiny 11 | Archive.org | Slow | 3.8 GB | tiny10 | Tiny 10 | Archive.org | Slow | 3.6 GB |
| | | |
|
---|
參考:https://github.com/dockur/windows https://soulteary.com/2024/03/11/install-windows-into-a-docker-container.html#%E5%86%99%E5%9C%A8%E5%89%8D%E9%9D%A2 | | | |
|