refactor: Use separate .env.modern and .env.legacy files

- Remove base-legacy.yml and base-modern.yml (YAML anchors don't work with include)
- Make all compose files self-contained
- Add .env.modern (8G RAM, 4 CPU) for Win 10/11, Server 2016+
- Add .env.legacy (2G RAM, 2 CPU) for older systems
- Update README and .env.example documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Michel Abboud 2026-01-28 23:44:10 +00:00
parent 620cda9282
commit c27837738d
22 changed files with 291 additions and 212 deletions

View File

@ -1,40 +1,24 @@
# Windows Docker VM Configuration
# Copy this file to .env and customize
# ===========================================
# MODERN SYSTEMS (Windows 10/11, Server 2016+)
# ===========================================
MODERN_RAM_SIZE=8G
MODERN_CPU_CORES=4
MODERN_DISK_SIZE=128G
# ===========================================
# LEGACY SYSTEMS (Windows 7/8, Vista, XP, 2000, Server 2003-2012)
# ===========================================
LEGACY_RAM_SIZE=2G
LEGACY_CPU_CORES=2
LEGACY_DISK_SIZE=32G
# ===========================================
# COMMON SETTINGS (applies to all)
# ===========================================
# User Credentials
USERNAME=Docker
PASSWORD=admin
# Language & Region
LANGUAGE=en
REGION=en-US
KEYBOARD=en-US
# Display
WIDTH=1280
HEIGHT=720
# Network
DHCP=N
SAMBA=Y
# Debug
DEBUG=N
#
# Two env files are provided with optimized defaults:
# - .env.modern (8G RAM, 4 CPU) - Windows 10/11, Server 2016+
# - .env.legacy (2G RAM, 2 CPU) - Windows 7/8, Vista, XP, 2000, Server 2003-2012, Tiny
#
# Each compose file references the appropriate env file automatically.
# Edit .env.modern or .env.legacy to customize settings.
#
# Available settings:
#
# RAM_SIZE=8G # Memory allocation
# CPU_CORES=4 # CPU cores
# DISK_SIZE=128G # Virtual disk size
# USERNAME=Docker # Windows username
# PASSWORD=admin # Windows password
# LANGUAGE=en # Installation language
# REGION=en-US # Region setting
# KEYBOARD=en-US # Keyboard layout
# WIDTH=1280 # Display width
# HEIGHT=720 # Display height
# DHCP=N # Use DHCP (Y/N)
# SAMBA=Y # Enable file sharing (Y/N)
# DEBUG=N # Debug mode (Y/N)

26
.env.legacy Normal file
View File

@ -0,0 +1,26 @@
# Legacy Systems Configuration (Windows 7/8, Vista, XP, 2000, Server 2003-2012, Tiny)
# Resources
RAM_SIZE=2G
CPU_CORES=2
DISK_SIZE=32G
# User Credentials
USERNAME=Docker
PASSWORD=admin
# Language & Region
LANGUAGE=en
REGION=en-US
KEYBOARD=en-US
# Display
WIDTH=1280
HEIGHT=720
# Network
DHCP=N
SAMBA=Y
# Debug
DEBUG=N

26
.env.modern Normal file
View File

@ -0,0 +1,26 @@
# Modern Systems Configuration (Windows 10/11, Server 2016+)
# Resources
RAM_SIZE=8G
CPU_CORES=4
DISK_SIZE=128G
# User Credentials
USERNAME=Docker
PASSWORD=admin
# Language & Region
LANGUAGE=en
REGION=en-US
KEYBOARD=en-US
# Display
WIDTH=1280
HEIGHT=720
# Network
DHCP=N
SAMBA=Y
# Debug
DEBUG=N

View File

@ -1,23 +0,0 @@
x-legacy: &legacy
image: dockurr/windows
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
restart: unless-stopped
stop_grace_period: 2m
environment:
RAM_SIZE: ${LEGACY_RAM_SIZE:-2G}
CPU_CORES: ${LEGACY_CPU_CORES:-2}
DISK_SIZE: ${LEGACY_DISK_SIZE:-32G}
USERNAME: ${USERNAME:-Docker}
PASSWORD: ${PASSWORD:-admin}
LANGUAGE: ${LANGUAGE:-en}
REGION: ${REGION:-en-US}
KEYBOARD: ${KEYBOARD:-en-US}
WIDTH: ${WIDTH:-1280}
HEIGHT: ${HEIGHT:-720}
DHCP: ${DHCP:-N}
SAMBA: ${SAMBA:-Y}
DEBUG: ${DEBUG:-N}

View File

@ -1,23 +0,0 @@
x-modern: &modern
image: dockurr/windows
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
restart: unless-stopped
stop_grace_period: 2m
environment:
RAM_SIZE: ${MODERN_RAM_SIZE:-8G}
CPU_CORES: ${MODERN_CPU_CORES:-4}
DISK_SIZE: ${MODERN_DISK_SIZE:-128G}
USERNAME: ${USERNAME:-Docker}
PASSWORD: ${PASSWORD:-admin}
LANGUAGE: ${LANGUAGE:-en}
REGION: ${REGION:-en-US}
KEYBOARD: ${KEYBOARD:-en-US}
WIDTH: ${WIDTH:-1280}
HEIGHT: ${HEIGHT:-720}
DHCP: ${DHCP:-N}
SAMBA: ${SAMBA:-Y}
DEBUG: ${DEBUG:-N}

View File

@ -1,42 +1,60 @@
include:
- ../base-modern.yml
services:
win10:
<<: *modern
image: dockurr/windows
container_name: win10
env_file: ../../.env
env_file: ../../.env.modern
environment:
VERSION: "10"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports:
- 8010:8006
- 3310:3389/tcp
- 3310:3389/udp
volumes:
- ../../data/win10:/storage
restart: unless-stopped
stop_grace_period: 2m
win10e:
<<: *modern
image: dockurr/windows
container_name: win10e
env_file: ../../.env
env_file: ../../.env.modern
environment:
VERSION: "10e"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports:
- 8014:8006
- 3314:3389/tcp
- 3314:3389/udp
volumes:
- ../../data/win10e:/storage
restart: unless-stopped
stop_grace_period: 2m
win10l:
<<: *modern
image: dockurr/windows
container_name: win10l
env_file: ../../.env
env_file: ../../.env.modern
environment:
VERSION: "10l"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports:
- 8015:8006
- 3315:3389/tcp
- 3315:3389/udp
volumes:
- ../../data/win10l:/storage
restart: unless-stopped
stop_grace_period: 2m

View File

@ -1,42 +1,60 @@
include:
- ../base-modern.yml
services:
win11:
<<: *modern
image: dockurr/windows
container_name: win11
env_file: ../../.env
env_file: ../../.env.modern
environment:
VERSION: "11"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports:
- 8011:8006
- 3311:3389/tcp
- 3311:3389/udp
volumes:
- ../../data/win11:/storage
restart: unless-stopped
stop_grace_period: 2m
win11e:
<<: *modern
image: dockurr/windows
container_name: win11e
env_file: ../../.env
env_file: ../../.env.modern
environment:
VERSION: "11e"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports:
- 8012:8006
- 3312:3389/tcp
- 3312:3389/udp
volumes:
- ../../data/win11e:/storage
restart: unless-stopped
stop_grace_period: 2m
win11l:
<<: *modern
image: dockurr/windows
container_name: win11l
env_file: ../../.env
env_file: ../../.env.modern
environment:
VERSION: "11l"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports:
- 8013:8006
- 3313:3389/tcp
- 3313:3389/udp
volumes:
- ../../data/win11l:/storage
restart: unless-stopped
stop_grace_period: 2m

View File

@ -1,29 +1,40 @@
include:
- ../base-legacy.yml
services:
win7:
<<: *legacy
image: dockurr/windows
container_name: win7
env_file: ../../.env
env_file: ../../.env.legacy
environment:
VERSION: "7u"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports:
- 8007:8006
- 3307:3389/tcp
- 3307:3389/udp
volumes:
- ../../data/win7:/storage
restart: unless-stopped
stop_grace_period: 2m
win7e:
<<: *legacy
image: dockurr/windows
container_name: win7e
env_file: ../../.env
env_file: ../../.env.legacy
environment:
VERSION: "7e"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports:
- 8071:8006
- 3371:3389/tcp
- 3371:3389/udp
volumes:
- ../../data/win7e:/storage
restart: unless-stopped
stop_grace_period: 2m

View File

@ -1,29 +1,40 @@
include:
- ../base-legacy.yml
services:
win81:
<<: *legacy
image: dockurr/windows
container_name: win81
env_file: ../../.env
env_file: ../../.env.legacy
environment:
VERSION: "8"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports:
- 8008:8006
- 3308:3389/tcp
- 3308:3389/udp
volumes:
- ../../data/win81:/storage
restart: unless-stopped
stop_grace_period: 2m
win81e:
<<: *legacy
image: dockurr/windows
container_name: win81e
env_file: ../../.env
env_file: ../../.env.legacy
environment:
VERSION: "8e"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports:
- 8081:8006
- 3381:3389/tcp
- 3381:3389/udp
volumes:
- ../../data/win81e:/storage
restart: unless-stopped
stop_grace_period: 2m

View File

@ -1,16 +1,20 @@
include:
- ../base-legacy.yml
services:
vista:
<<: *legacy
image: dockurr/windows
container_name: vista
env_file: ../../.env
env_file: ../../.env.legacy
environment:
VERSION: "vu"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports:
- 8006:8006
- 3306:3389/tcp
- 3306:3389/udp
volumes:
- ../../data/vista:/storage
restart: unless-stopped
stop_grace_period: 2m

View File

@ -1,16 +1,20 @@
include:
- ../base-legacy.yml
services:
win2k:
<<: *legacy
image: dockurr/windows
container_name: win2k
env_file: ../../.env
env_file: ../../.env.legacy
environment:
VERSION: "2k"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports:
- 8000:8006
- 3300:3389/tcp
- 3300:3389/udp
volumes:
- ../../data/win2k:/storage
restart: unless-stopped
stop_grace_period: 2m

View File

@ -1,16 +1,20 @@
include:
- ../base-legacy.yml
services:
winxp:
<<: *legacy
image: dockurr/windows
container_name: winxp
env_file: ../../.env
env_file: ../../.env.legacy
environment:
VERSION: "xp"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports:
- 8005:8006
- 3305:3389/tcp
- 3305:3389/udp
volumes:
- ../../data/winxp:/storage
restart: unless-stopped
stop_grace_period: 2m

View File

@ -1,16 +1,20 @@
include:
- ../base-legacy.yml
services:
win2003:
<<: *legacy
image: dockurr/windows
container_name: win2003
env_file: ../../.env
env_file: ../../.env.legacy
environment:
VERSION: "2003"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports:
- 8003:8006
- 3303:3389/tcp
- 3303:3389/udp
volumes:
- ../../data/win2003:/storage
restart: unless-stopped
stop_grace_period: 2m

View File

@ -1,16 +1,20 @@
include:
- ../base-legacy.yml
services:
win2008:
<<: *legacy
image: dockurr/windows
container_name: win2008
env_file: ../../.env
env_file: ../../.env.legacy
environment:
VERSION: "2008"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports:
- 8108:8006
- 3208:3389/tcp
- 3208:3389/udp
volumes:
- ../../data/win2008:/storage
restart: unless-stopped
stop_grace_period: 2m

View File

@ -1,16 +1,20 @@
include:
- ../base-legacy.yml
services:
win2012:
<<: *legacy
image: dockurr/windows
container_name: win2012
env_file: ../../.env
env_file: ../../.env.legacy
environment:
VERSION: "2012"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports:
- 8112:8006
- 3212:3389/tcp
- 3212:3389/udp
volumes:
- ../../data/win2012:/storage
restart: unless-stopped
stop_grace_period: 2m

View File

@ -1,16 +1,20 @@
include:
- ../base-modern.yml
services:
win2016:
<<: *modern
image: dockurr/windows
container_name: win2016
env_file: ../../.env
env_file: ../../.env.modern
environment:
VERSION: "2016"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports:
- 8016:8006
- 3316:3389/tcp
- 3316:3389/udp
volumes:
- ../../data/win2016:/storage
restart: unless-stopped
stop_grace_period: 2m

View File

@ -1,16 +1,20 @@
include:
- ../base-modern.yml
services:
win2019:
<<: *modern
image: dockurr/windows
container_name: win2019
env_file: ../../.env
env_file: ../../.env.modern
environment:
VERSION: "2019"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports:
- 8019:8006
- 3319:3389/tcp
- 3319:3389/udp
volumes:
- ../../data/win2019:/storage
restart: unless-stopped
stop_grace_period: 2m

View File

@ -1,16 +1,20 @@
include:
- ../base-modern.yml
services:
win2022:
<<: *modern
image: dockurr/windows
container_name: win2022
env_file: ../../.env
env_file: ../../.env.modern
environment:
VERSION: "2022"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports:
- 8022:8006
- 3322:3389/tcp
- 3322:3389/udp
volumes:
- ../../data/win2022:/storage
restart: unless-stopped
stop_grace_period: 2m

View File

@ -1,16 +1,20 @@
include:
- ../base-modern.yml
services:
win2025:
<<: *modern
image: dockurr/windows
container_name: win2025
env_file: ../../.env
env_file: ../../.env.modern
environment:
VERSION: "2025"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports:
- 8025:8006
- 3325:3389/tcp
- 3325:3389/udp
volumes:
- ../../data/win2025:/storage
restart: unless-stopped
stop_grace_period: 2m

View File

@ -1,16 +1,20 @@
include:
- ../base-legacy.yml
services:
tiny10:
<<: *legacy
image: dockurr/windows
container_name: tiny10
env_file: ../../.env
env_file: ../../.env.legacy
environment:
VERSION: "tiny10"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports:
- 8110:8006
- 3110:3389/tcp
- 3110:3389/udp
volumes:
- ../../data/tiny10:/storage
restart: unless-stopped
stop_grace_period: 2m

View File

@ -1,16 +1,20 @@
include:
- ../base-legacy.yml
services:
tiny11:
<<: *legacy
image: dockurr/windows
container_name: tiny11
env_file: ../../.env
env_file: ../../.env.legacy
environment:
VERSION: "tiny11"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports:
- 8111:8006
- 3111:3389/tcp
- 3111:3389/udp
volumes:
- ../../data/tiny11:/storage
restart: unless-stopped
stop_grace_period: 2m

View File

@ -112,39 +112,27 @@ Use `winctl.sh` for easy container management:
### Quick Start (Manual)
```bash
# Copy environment template
cp .env.example .env
# Run default (Windows 11)
docker compose up
# Run specific version
docker compose -f compose/desktop/win11.yml up win11
docker compose -f compose/legacy/winxp.yml up winxp
# Run all desktop versions
docker compose -f compose/desktop.yml up
# Run everything
docker compose -f compose/all.yml up
```
### Configuration
Edit `.env` to customize resources for all VMs:
Two pre-configured env files with optimized defaults:
| File | RAM | CPU | Disk | Used By |
|------|-----|-----|------|---------|
| `.env.modern` | 8G | 4 | 128G | Win 10/11, Server 2016+ |
| `.env.legacy` | 2G | 2 | 32G | Win 7/8, Vista, XP, 2000, Server 2003-2012, Tiny |
Edit these files to customize:
```bash
# Modern systems (Win 10/11, Server 2016+)
MODERN_RAM_SIZE=8G
MODERN_CPU_CORES=4
MODERN_DISK_SIZE=128G
# Legacy systems (Win 7/8, Vista, XP, 2000, Server 2003-2012, Tiny)
LEGACY_RAM_SIZE=2G
LEGACY_CPU_CORES=2
LEGACY_DISK_SIZE=32G
# Common settings
# .env.modern or .env.legacy
RAM_SIZE=8G
CPU_CORES=4
DISK_SIZE=128G
USERNAME=Docker
PASSWORD=admin
LANGUAGE=en
@ -153,18 +141,13 @@ LANGUAGE=en
### Folder Structure
```
.env.modern # Modern system defaults (8G RAM)
.env.legacy # Legacy system defaults (2G RAM)
compose/
├── base-modern.yml # High-resource profile
├── base-legacy.yml # Low-resource profile
├── all.yml # All versions
├── desktop.yml # Desktop versions
├── legacy.yml # Vista, XP, 2000
├── server.yml # Server versions
├── tiny.yml # Tiny versions
├── desktop/ # Individual desktop configs
├── legacy/ # Individual legacy configs
├── server/ # Individual server configs
└── tiny/ # Individual tiny configs
├── desktop/ # Win 11, 10, 8.1, 7
├── legacy/ # Vista, XP, 2000
├── server/ # Server 2003-2025
└── tiny/ # Tiny10, Tiny11
data/ # VM storage (per-version folders)
├── win11/