# Use a minimal Debian base image FROM debian:bookworm-slim # Set non-interactive mode for package installation ARG DEBIAN_FRONTEND="noninteractive" # Ensure we install sudo for privilege management RUN apt-get update && \ apt-get --no-install-recommends -y install \ curl \ p7zip-full \ wsdd \ samba \ wimtools \ dos2unix \ cabextract \ genisoimage \ libxml2-utils \ sudo \ tini && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* # Copy necessary files from qemux/qemu-docker image COPY --from=qemux/qemu-docker:4.14 / / # Copy custom scripts and assets COPY ./src /run/ COPY ./assets /run/assets # Add external scripts and drivers ADD https://raw.githubusercontent.com/christgau/wsdd/master/src/wsdd.py /usr/sbin/wsdd ADD https://github.com/qemus/virtiso/releases/download/v0.1.240/virtio-win-0.1.240.iso /run/drivers.iso # Ensure necessary scripts have execute permissions and are owned by root RUN chmod +x /run/*.sh /usr/sbin/wsdd && \ chmod 755 /run/entry.sh && \ chown root:root /run/entry.sh # Expose necessary ports EXPOSE 7860 # Define a volume for storage VOLUME /storage # Set environment variables ENV RAM_SIZE="4G" ENV CPU_CORES="2" ENV DISK_SIZE="64G" ENV VERSION="win11" # Store version argument in a file ARG VERSION_ARG="0.0" RUN echo "$VERSION_ARG" > /run/version # Ensure the script runs as root USER root # Define entrypoint script using Tini for proper process management ENTRYPOINT ["/usr/bin/tini", "-s", "/run/entry.sh"]