mirror of
https://github.com/dockur/windows.git
synced 2026-01-22 10:53:06 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21ea7584a4 | ||
|
|
0652998966 | ||
|
|
131fa1379b | ||
|
|
748bf5f4e7 | ||
|
|
7cc56998cb |
@@ -8,17 +8,23 @@ RUN apt-get update \
|
|||||||
&& apt-get --no-install-recommends -y install \
|
&& apt-get --no-install-recommends -y install \
|
||||||
curl \
|
curl \
|
||||||
novnc \
|
novnc \
|
||||||
|
swtpm \
|
||||||
|
p7zip-full \
|
||||||
|
genisoimage \
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||||
|
|
||||||
COPY ./src /run/
|
COPY ./src /run/
|
||||||
|
|
||||||
ADD https://raw.githubusercontent.com/ElliotKillick/Mido/main/Mido.sh /run/mido.sh
|
ADD https://raw.githubusercontent.com/ElliotKillick/Mido/main/Mido.sh /run/mido.sh
|
||||||
|
ADD https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso /run/drivers.iso
|
||||||
|
|
||||||
RUN chmod +x /run/*.sh
|
RUN chmod +x /run/*.sh
|
||||||
|
|
||||||
EXPOSE 8006
|
EXPOSE 8006
|
||||||
VOLUME /storage
|
VOLUME /storage
|
||||||
|
|
||||||
ENV CPU_CORES "1"
|
ENV CPU_CORES "2"
|
||||||
ENV RAM_SIZE "4G"
|
ENV RAM_SIZE "4G"
|
||||||
ENV DISK_SIZE "64G"
|
ENV DISK_SIZE "64G"
|
||||||
|
|
||||||
|
|||||||
10
readme.md
10
readme.md
@@ -29,7 +29,7 @@ services:
|
|||||||
container_name: windows
|
container_name: windows
|
||||||
image: dockurr/windows:latest
|
image: dockurr/windows:latest
|
||||||
environment:
|
environment:
|
||||||
VERSION: "win10x64"
|
VERSION: "win11x64"
|
||||||
devices:
|
devices:
|
||||||
- /dev/kvm
|
- /dev/kvm
|
||||||
cap_add:
|
cap_add:
|
||||||
@@ -43,7 +43,7 @@ services:
|
|||||||
Via `docker run`
|
Via `docker run`
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker run -it --rm -e "VERSION=win10x64" -p 8006:8006 --device=/dev/kvm --cap-add NET_ADMIN dockurr/windows:latest
|
docker run -it --rm -e "VERSION=win11x64" -p 8006:8006 --device=/dev/kvm --cap-add NET_ADMIN dockurr/windows:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
## FAQ
|
## FAQ
|
||||||
@@ -54,12 +54,12 @@ docker run -it --rm -e "VERSION=win10x64" -p 8006:8006 --device=/dev/kvm --cap-a
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
environment:
|
environment:
|
||||||
VERSION: "win10x64"
|
VERSION: "win11x64"
|
||||||
```
|
```
|
||||||
|
|
||||||
Select from the values below:
|
Select from the values below:
|
||||||
|
|
||||||
- ~~```win11x64``` (Windows 11)~~
|
- ```win11x64``` (Windows 11)
|
||||||
- ```win10x64``` (Windows 10)
|
- ```win10x64``` (Windows 10)
|
||||||
- ```win81x64``` (Windows 8.1)
|
- ```win81x64``` (Windows 8.1)
|
||||||
- ```win7x64-ultimate``` (Windows 7 )
|
- ```win7x64-ultimate``` (Windows 7 )
|
||||||
@@ -75,7 +75,7 @@ docker run -it --rm -e "VERSION=win10x64" -p 8006:8006 --device=/dev/kvm --cap-a
|
|||||||
|
|
||||||
* ### How do I increase the amount of CPU or RAM?
|
* ### How do I increase the amount of CPU or RAM?
|
||||||
|
|
||||||
By default, a single core and 4 GB of RAM are allocated to the container.
|
By default, 2 CPU cores and 4 GB of RAM are allocated to the container.
|
||||||
|
|
||||||
To increase this, add the following environment variables:
|
To increase this, add the following environment variables:
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,9 @@ if [[ "${DISPLAY,,}" == "web" ]]; then
|
|||||||
websockify -D --web /usr/share/novnc/ 8006 localhost:5900 2>/dev/null
|
websockify -D --web /usr/share/novnc/ 8006 localhost:5900 2>/dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
mkdir -p /tmp/emulated_tpm
|
||||||
|
swtpm socket -t -d --tpmstate dir=/tmp/emulated_tpm --ctrl type=unixio,path=/tmp/emulated_tpm/swtpm-sock --log level=1 --tpm2
|
||||||
|
|
||||||
info "Booting Windows using $VERS..."
|
info "Booting Windows using $VERS..."
|
||||||
|
|
||||||
[[ "$DEBUG" == [Yy1]* ]] && set -x
|
[[ "$DEBUG" == [Yy1]* ]] && set -x
|
||||||
|
|||||||
@@ -1,40 +1,38 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -Eeuo pipefail
|
set -Eeuo pipefail
|
||||||
|
|
||||||
: "${VERSION:="win10x64"}"
|
: "${VERSION:="win11x64"}"
|
||||||
|
|
||||||
|
ARGUMENTS="-chardev socket,id=chrtpm,path=/tmp/emulated_tpm/swtpm-sock $ARGUMENTS"
|
||||||
|
ARGUMENTS="-tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis,tpmdev=tpm0 $ARGUMENTS"
|
||||||
|
|
||||||
BASE="$VERSION.iso"
|
BASE="$VERSION.iso"
|
||||||
[ -f "$STORAGE/$BASE" ] && return 0
|
[ -f "$STORAGE/$BASE" ] && return 0
|
||||||
|
|
||||||
# Check if running with interactive TTY or redirected to docker log
|
DEST="$STORAGE/drivers.img"
|
||||||
if [ -t 1 ]; then
|
[ ! -f "$DEST" ] && cp /run/drivers.iso "$DEST"
|
||||||
PROGRESS="--progress=bar:noscroll"
|
|
||||||
else
|
|
||||||
PROGRESS="--progress=dot:giga"
|
|
||||||
fi
|
|
||||||
|
|
||||||
SCRIPT="$STORAGE/mido.sh"
|
rm -rf "$STORAGE/tmp"
|
||||||
|
mkdir -p "$STORAGE/tmp"
|
||||||
|
SCRIPT="$STORAGE/tmp/mido.sh"
|
||||||
|
|
||||||
rm -f "$SCRIPT"
|
|
||||||
cp /run/mido.sh "$SCRIPT"
|
cp /run/mido.sh "$SCRIPT"
|
||||||
chmod +x "$SCRIPT"
|
chmod +x "$SCRIPT"
|
||||||
|
|
||||||
|
cd "$STORAGE/tmp"
|
||||||
bash "$SCRIPT" "$VERSION"
|
bash "$SCRIPT" "$VERSION"
|
||||||
rm -f "$SCRIPT"
|
rm -f "$SCRIPT"
|
||||||
|
|
||||||
[ ! -f "$STORAGE/$BASE" ] && error "Failed to download $VERSION.iso!" && exit 66
|
[ ! -f "$STORAGE/tmp/$BASE" ] && error "Failed to download $VERSION.iso from the Microsoft servers!" && exit 66
|
||||||
|
|
||||||
DEST="$STORAGE/drivers.img"
|
info "Customizing ISO to remove keypress requirement during boot..."
|
||||||
|
|
||||||
if [ ! -f "$DEST" ]; then
|
7z x "$BASE" -ounpack
|
||||||
|
genisoimage -b boot/etfsboot.com -no-emul-boot -c BOOT.CAT -iso-level 4 -J -l -D -N -joliet-long -relaxed-filenames -v -V "Custom" -udf -boot-info-table -eltorito-alt-boot -eltorito-boot efi/microsoft/boot/efisys_noprompt.bin -no-emul-boot -o "$STORAGE/tmp/$BASE.tmp" -allow-limited-size unpack
|
||||||
|
|
||||||
info "Downloading VirtIO drivers for Windows..."
|
mv "$STORAGE/tmp/$BASE.tmp" "$STORAGE/$BASE"
|
||||||
DRIVERS="https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso"
|
rm -rf "$STORAGE/tmp"
|
||||||
|
|
||||||
{ wget "$DRIVERS" -O "$DEST" -q --no-check-certificate --show-progress "$PROGRESS"; rc=$?; } || :
|
cd /run
|
||||||
|
|
||||||
(( rc != 0 )) && info "Failed to download $DRIVERS, reason: $rc" && rm -f "$DEST"
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
Reference in New Issue
Block a user