diff --git a/Dockerfile b/Dockerfile index 520c47d..1dd335d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,6 +41,5 @@ EXPOSE 3389 8006 ENV RAM_SIZE="4G" ENV CPU_CORES="2" ENV DISK_SIZE="30G" -ENV VERSION="win11e" ENTRYPOINT ["/usr/bin/tini", "-s", "/run/entry.sh"] diff --git a/compose.prepare.yml b/compose.prepare.yml new file mode 100644 index 0000000..45efc7b --- /dev/null +++ b/compose.prepare.yml @@ -0,0 +1,19 @@ +services: + prepare-windows: + image: windows-local:latest + container_name: prepare-windows + environment: + ISO_FILE: "${ISO_FILE:?Error: required env var not set}" + STORAGE_DIR: "${STORAGE_DIR:?Error: required env var not set}" + devices: + - /dev/kvm + cap_add: + - NET_ADMIN + ports: + - 8006:8006 + - 3389:3389/tcp + - 3389:3389/udp + stop_grace_period: 2m + volumes: + - ${ISO_FILE}:/custom.iso + - ${STORAGE_DIR}:/storage diff --git a/compose.yml b/compose.yml index 917cafa..f50ef2b 100644 --- a/compose.yml +++ b/compose.yml @@ -3,8 +3,7 @@ services: image: windows-local:latest container_name: windows environment: - VERSION: "win11e" - STORAGE: "${STORAGE:?Error: required env var not set}" + STORAGE_DIR: "${STORAGE_DIR:?Error: required env var not set}" devices: - /dev/kvm cap_add: @@ -15,15 +14,4 @@ services: - 3389:3389/udp stop_grace_period: 2m volumes: - - ${STORAGE}:/storage - - prepare-golden-image: - extends: - service: windows - profiles: - - prepare-golden-image - environment: - ISO: "${ISO:?Error: required env var not set}" - volumes: - - ${ISO}:/custom.iso - - ${STORAGE}:/storage + - ${STORAGE_DIR}:/storage diff --git a/readme.md b/readme.md index 65b4150..0e71923 100644 --- a/readme.md +++ b/readme.md @@ -16,13 +16,13 @@ Local Windows inside a Docker container. To prepare a golden image from a custom ISO: ```bash -STORAGE=/path/to/storage ISO=/path/to/custom.iso \ - docker compose --profile prepare-golden-image up +STORAGE_DIR=/path/to/storage ISO_FILE=/path/to/custom.iso \ + docker compose -f compose.prepare.yml up ``` -Start the container: +Start the container (using the golden image): ```bash -STORAGE=/path/to/storage docker compose up +STORAGE_DIR=/path/to/storage docker compose up ``` ### Via Docker CLI: