diff options
| author | sickcodes <[email protected]> | 2022-02-24 00:45:19 +0000 |
|---|---|---|
| committer | sickcodes <[email protected]> | 2022-02-24 00:45:19 +0000 |
| commit | 235917cf8482280ab6f05ad6b1adebdf7317329d (patch) | |
| tree | 0db4fb1f1d3fb79c0668691dfefb3cf63d522aad /Dockerfile | |
| parent | If you put an image at /imamge, the image will use that at runtime. Move OSX-... (diff) | |
| download | docker-osx-persistent.tar.xz docker-osx-persistent.zip | |
Move `/home/arch/OSX-KVM` to `/home/arch/Docker-OSX/OSX-KVM`, but symlink it anywaypersistent
Diffstat (limited to 'Dockerfile')
| -rw-r--r-- | Dockerfile | 41 |
1 files changed, 23 insertions, 18 deletions
@@ -114,14 +114,16 @@ RUN tee -a sshd_config <<< 'AllowTcpForwarding yes' \ USER arch # download OSX-KVM -# RUN git clone --recurse-submodules --depth 1 https://github.com/kholia/OSX-KVM.git /home/arch/OSX-KVM -RUN git clone --recurse-submodules --depth 1 https://github.com/kholia/OSX-KVM.git /home/arch/OSX-KVM +# RUN git clone --recurse-submodules --depth 1 https://github.com/kholia/OSX-KVM.git /home/arch/Docker-OSX/OSX-KVM +RUN git clone --recurse-submodules --depth 1 https://github.com/sickcodes/Docker-OSX.git /home/arch/Docker-OSX + +# Create a symbolic link from OSX-KVM to submodule directory as we are using as a submodule instead now (redunancy proof) +RUN ln -s /home/arch/Docker-OSX/OSX-KVM /home/arch/OSX-KVM # enable ssh # docker exec .... ./enable-ssh.sh -USER arch -WORKDIR /home/arch/OSX-KVM +WORKDIR /home/arch/Docker-OSX RUN touch enable-ssh.sh \ && chmod +x ./enable-ssh.sh \ @@ -143,7 +145,7 @@ RUN touch enable-ssh.sh \ RUN yes | sudo pacman -Syu bc qemu libvirt dnsmasq virt-manager bridge-utils openresolv jack2 ebtables edk2-ovmf netctl libvirt-dbus wget --overwrite --noconfirm \ && yes | sudo pacman -Scc -WORKDIR /home/arch/OSX-KVM +WORKDIR /home/arch/Docker-OSX/OSX-KVM # RUN wget https://raw.githubusercontent.com/kholia/OSX-KVM/master/fetch-macOS-v2.py @@ -181,16 +183,16 @@ RUN touch Launch.sh \ && tee -a Launch.sh <<< '-smp ${CPU_STRING:-${SMP:-4},cores=${CORES:-4}} \' \ && tee -a Launch.sh <<< '-usb -device usb-kbd -device usb-tablet \' \ && tee -a Launch.sh <<< '-device isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal\(c\)AppleComputerInc \' \ - && tee -a Launch.sh <<< '-drive if=pflash,format=raw,readonly=on,file=/home/arch/OSX-KVM/OVMF_CODE.fd \' \ - && tee -a Launch.sh <<< '-drive if=pflash,format=raw,file=/home/arch/OSX-KVM/OVMF_VARS-1024x768.fd \' \ + && tee -a Launch.sh <<< '-drive if=pflash,format=raw,readonly=on,file=/home/arch/Docker-OSX/OSX-KVM/OVMF_CODE.fd \' \ + && tee -a Launch.sh <<< '-drive if=pflash,format=raw,file=/home/arch/Docker-OSX/OSX-KVM/OVMF_VARS-1024x768.fd \' \ && tee -a Launch.sh <<< '-smbios type=2 \' \ && tee -a Launch.sh <<< '-audiodev ${AUDIO_DRIVER:-alsa},id=hda -device ich9-intel-hda -device hda-duplex,audiodev=hda \' \ && tee -a Launch.sh <<< '-device ich9-ahci,id=sata \' \ - && tee -a Launch.sh <<< '-drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file=${BOOTDISK:-/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2} \' \ + && tee -a Launch.sh <<< '-drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file=${BOOTDISK:-/home/arch/Docker-OSX/OSX-KVM/OpenCore/OpenCore.qcow2} \' \ && tee -a Launch.sh <<< '-device ide-hd,bus=sata.2,drive=OpenCoreBoot \' \ && tee -a Launch.sh <<< '-device ide-hd,bus=sata.3,drive=InstallMedia \' \ - && tee -a Launch.sh <<< '-drive id=InstallMedia,if=none,file=/home/arch/OSX-KVM/BaseSystem.img,format=${BASESYSTEM_FORMAT:-qcow2} \' \ - && tee -a Launch.sh <<< '-drive id=MacHDD,if=none,file=${IMAGE_PATH:-/home/arch/OSX-KVM/mac_hdd_ng.img},format=${IMAGE_FORMAT:-qcow2} \' \ + && tee -a Launch.sh <<< '-drive id=InstallMedia,if=none,file=/home/arch/Docker-OSX/OSX-KVM/BaseSystem.img,format=${BASESYSTEM_FORMAT:-qcow2} \' \ + && tee -a Launch.sh <<< '-drive id=MacHDD,if=none,file=${IMAGE_PATH:-/home/arch/Docker-OSX/OSX-KVM/mac_hdd_ng.img},format=${IMAGE_FORMAT:-qcow2} \' \ && tee -a Launch.sh <<< '-device ide-hd,bus=sata.4,drive=MacHDD \' \ && tee -a Launch.sh <<< '-netdev user,id=net0,hostfwd=tcp::${INTERNAL_SSH_PORT:-10022}-:22,hostfwd=tcp::${SCREEN_SHARE_PORT:-5900}-:5900,${ADDITIONAL_PORTS} \' \ && tee -a Launch.sh <<< '-device ${NETWORKING:-vmxnet3},netdev=net0,id=net0,mac=${MAC_ADDRESS:-52:54:00:09:49:17} \' \ @@ -257,8 +259,8 @@ ARG STOCK_WIDTH=1920 ARG STOCK_HEIGHT=1080 ARG STOCK_MASTER_PLIST_URL=https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist ARG STOCK_MASTER_PLIST_URL_NOPICKER=https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-nopicker-custom.plist -ARG STOCK_BOOTDISK=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2 -ARG STOCK_BOOTDISK_NOPICKER=/home/arch/OSX-KVM/OpenCore/OpenCore-nopicker.qcow2 +ARG STOCK_BOOTDISK=/home/arch/Docker-OSX/OSX-KVM/OpenCore/OpenCore.qcow2 +ARG STOCK_BOOTDISK_NOPICKER=/home/arch/Docker-OSX/OSX-KVM/OpenCore/OpenCore-nopicker.qcow2 RUN ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \ --master-plist-url="${STOCK_MASTER_PLIST_URL}" \ @@ -285,7 +287,7 @@ RUN ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \ ; rm -rf /var/tmp/.guestfs-* ### symlink the old directory as upstream has renamed a directory. Symlinking purely for backwards compatability! -RUN ln -s /home/arch/OSX-KVM/OpenCore /home/arch/OSX-KVM/OpenCore-Catalina || true +RUN ln -s /home/arch/Docker-OSX/OSX-KVM/OpenCore /home/arch/Docker-OSX/OSX-KVM/OpenCore-Catalina || true #### #### SPECIAL RUNTIME ARGUMENTS BELOW @@ -318,7 +320,7 @@ ENV GENERATE_UNIQUE=false # Boolean for generating a bootdisk with specific serials. ENV GENERATE_SPECIFIC=false -ENV IMAGE_PATH=/home/arch/OSX-KVM/mac_hdd_ng.img +ENV IMAGE_PATH=/home/arch/Docker-OSX/OSX-KVM/mac_hdd_ng.img ENV IMAGE_FORMAT=qcow2 ENV KVM='accel=kvm:tcg' @@ -366,9 +368,12 @@ CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/n ; sudo chown -R $(id -u):$(id -g) /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \ ; [[ "${NOPICKER}" == true ]] && { \ sed -i '/^.*InstallMedia.*/d' Launch.sh \ - && export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore-nopicker.qcow2}" \ + && export BOOTDISK="${BOOTDISK:=/home/arch/Docker-OSX/OSX-KVM/OpenCore/OpenCore-nopicker.qcow2}" \ + ; } \ + ; [[ "$(fdisk -l /image)" ]] && { \ + && export IMAGE_PATH=/image \ ; } \ - || export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \ + || export BOOTDISK="${BOOTDISK:=/home/arch/Docker-OSX/OSX-KVM/OpenCore/OpenCore.qcow2}" \ ; [[ "${GENERATE_UNIQUE}" == true ]] && { \ ./Docker-OSX/osx-serial-generator/generate-unique-machine-values.sh \ --master-plist-url="${MASTER_PLIST_URL}" \ @@ -377,7 +382,7 @@ CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/n --bootdisks \ --width "${WIDTH:-1920}" \ --height "${HEIGHT:-1080}" \ - --output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \ + --output-bootdisk "${BOOTDISK:=/home/arch/Docker-OSX/OSX-KVM/OpenCore/OpenCore.qcow2}" \ --output-env "${ENV:=/env}" \ || exit 1 ; } \ ; [[ "${GENERATE_SPECIFIC}" == true ]] && { \ @@ -391,7 +396,7 @@ CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/n --mac-address "${MAC_ADDRESS}" \ --width "${WIDTH:-1920}" \ --height "${HEIGHT:-1080}" \ - --output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \ + --output-bootdisk "${BOOTDISK:=/home/arch/Docker-OSX/OSX-KVM/OpenCore/OpenCore.qcow2}" \ || exit 1 ; } \ ; ./enable-ssh.sh && /bin/bash -c ./Launch.sh |