File size: 1,214 Bytes
69e5536
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Use Ubuntu 26.04 as the base image
FROM ubuntu:26.04

# 1. Install QEMU, UEFI (OVMF), and necessary tools
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
    qemu-system-x86 \
    qemu-utils \
    ovmf \
    net-tools \
    novnc \
    wget \
    zip \
    python3-websockify \
    python3-numpy \
    strace \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

# 2. Setup Working Directory
WORKDIR /vm

# 3. Download OpenCore ISO
RUN wget "https://github.com/thenickdude/KVM-Opencore/releases/download/v21/OpenCore-v21.iso.gz" -O /vm/OpenCore.iso.gz \
    && gzip -d /vm/OpenCore.iso.gz

# 4. Download OVMF Firmware Files
RUN wget "https://raw.githubusercontent.com/kholia/OSX-KVM/master/OVMF_CODE_4M.fd" -O /vm/OVMF_CODE.fd && \
    wget "https://raw.githubusercontent.com/kholia/OSX-KVM/master/OVMF_VARS-1920x1080.fd" -O /vm/OVMF_VARS.fd

# 4. Copy Source QCOW2 Image (Read-Only Source)
COPY mac15-image/mac15.qcow2 /vm/source.qcow2

# 5. Copy the Entrypoint Script
COPY entrypoint.sh /scripts/entrypoint.sh
RUN chmod +x /scripts/entrypoint.sh

# 6. Expose Necessary Ports
EXPOSE 5900 4000 4444 2222 8006 9090

# 7. Define Entrypoint
ENTRYPOINT ["/scripts/entrypoint.sh"]