You've already forked Docker-OSX
mirror of
https://github.com/sickcodes/Docker-OSX.git
synced 2025-07-03 03:03:31 -05:00
Compare commits
42 Commits
stock-imag
...
shrink-nak
Author | SHA1 | Date | |
---|---|---|---|
2d79f06079 | |||
c9b33ddb62 | |||
4805b9169b | |||
e55e55229d | |||
bc79a1fffb | |||
abce04d6fe | |||
5fdf587a29 | |||
8689e0e12c | |||
9ca9372da1 | |||
b820ec4ef2 | |||
8112e97bbf | |||
cc4303b5f3 | |||
71e4fa60cd | |||
6729dd7877 | |||
7da38e0d83 | |||
7f7a24f1d3 | |||
c913b66853 | |||
629563eb52 | |||
31247a5f63 | |||
d36ac07b34 | |||
c65f80ab16 | |||
e6fcfd86db | |||
0a0ae76333 | |||
dca8b28f9f | |||
50c87a4bac | |||
1d8682403f | |||
d40be09953 | |||
9639fa2289 | |||
24033387a3 | |||
7dfd04eafd | |||
5806f862d3 | |||
5a159c19e9 | |||
1d6168dfed | |||
50c5dce110 | |||
ff250fa0ca | |||
302885dc08 | |||
fcfba30086 | |||
df10b3c651 | |||
e265065e31 | |||
beef908d4c | |||
12b8ce7a2b | |||
9c8d70c9da |
@ -92,4 +92,8 @@ This project now uses the fantastic OpenCore bootloader from the community OpenC
|
|||||||
|
|
||||||
[@cybik](https://github.com/cybik) Spice fix #337
|
[@cybik](https://github.com/cybik) Spice fix #337
|
||||||
|
|
||||||
[@Silfalion](https://github.com/Silfalion) - [https://github.com/Silfalion/Iphone_docker_osx_passthrough](https://github.com/Silfalion/Iphone_docker_osx_passthrough)
|
[@Silfalion](https://github.com/Silfalion) - [https://github.com/Silfalion/Iphone_docker_osx_passthrough](https://github.com/Silfalion/Iphone_docker_osx_passthrough)
|
||||||
|
|
||||||
|
[@Buthrakaur](https://github.com/Buthrakaur) readme - improve instructions for running on windows #361
|
||||||
|
|
||||||
|
[@eggplants](https://github.com/eggplants) Fix command to launch sickcodes/docker-osx:auto #366
|
||||||
|
104
Dockerfile
104
Dockerfile
@ -52,14 +52,12 @@
|
|||||||
# # you will also need to pass the device to the container
|
# # you will also need to pass the device to the container
|
||||||
|
|
||||||
FROM archlinux:base-devel
|
FROM archlinux:base-devel
|
||||||
|
LABEL maintainer='https://twitter.com/sickcodes <https://sick.codes>'
|
||||||
MAINTAINER 'https://twitter.com/sickcodes' <https://sick.codes>
|
|
||||||
|
|
||||||
SHELL ["/bin/bash", "-c"]
|
SHELL ["/bin/bash", "-c"]
|
||||||
|
|
||||||
# change disk size here or add during build, e.g. --build-arg VERSION=10.14.5 --build-arg SIZE=50G
|
# change disk size here or add during build, e.g. --build-arg VERSION=10.14.5 --build-arg SIZE=50G
|
||||||
ARG SIZE=200G
|
ARG SIZE=200G
|
||||||
ARG VERSION=10.15.6
|
|
||||||
|
|
||||||
# OPTIONAL: Arch Linux server mirrors for super fast builds
|
# OPTIONAL: Arch Linux server mirrors for super fast builds
|
||||||
# set RANKMIRRORS to any value other that nothing, e.g. -e RANKMIRRORS=true
|
# set RANKMIRRORS to any value other that nothing, e.g. -e RANKMIRRORS=true
|
||||||
@ -140,32 +138,18 @@ RUN touch enable-ssh.sh \
|
|||||||
|
|
||||||
# RUN yes | sudo pacman -Syu qemu libvirt dnsmasq virt-manager bridge-utils edk2-ovmf netctl libvirt-dbus --overwrite --noconfirm
|
# RUN yes | sudo pacman -Syu qemu libvirt dnsmasq virt-manager bridge-utils edk2-ovmf netctl libvirt-dbus --overwrite --noconfirm
|
||||||
|
|
||||||
RUN yes | sudo pacman -Syu qemu libvirt dnsmasq virt-manager bridge-utils openresolv jack ebtables edk2-ovmf netctl libvirt-dbus wget --overwrite --noconfirm \
|
RUN yes | sudo pacman -Syu bc qemu libvirt dnsmasq virt-manager bridge-utils openresolv jack ebtables edk2-ovmf netctl libvirt-dbus wget --overwrite --noconfirm \
|
||||||
&& yes | sudo pacman -Scc
|
&& yes | sudo pacman -Scc
|
||||||
|
|
||||||
WORKDIR /home/arch/OSX-KVM
|
WORKDIR /home/arch/OSX-KVM
|
||||||
|
|
||||||
RUN wget https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/fetch-macOS.py
|
# RUN wget https://raw.githubusercontent.com/kholia/OSX-KVM/master/fetch-macOS-v2.py
|
||||||
|
|
||||||
RUN [[ "${VERSION%%.*}" -lt 11 ]] && { python fetch-macOS.py --version "${VERSION}" \
|
ARG SHORTNAME=catalina
|
||||||
&& qemu-img convert BaseSystem.dmg -O qcow2 -p -c BaseSystem.img \
|
|
||||||
&& qemu-img create -f qcow2 mac_hdd_ng.img "${SIZE}" \
|
|
||||||
&& rm -f BaseSystem.dmg \
|
|
||||||
; } || true
|
|
||||||
|
|
||||||
# VERSION=11.2.1
|
RUN make \
|
||||||
# this downloads LATEST ONLY
|
&& qemu-img convert BaseSystem.dmg -O qcow2 -p -c BaseSystem.img \
|
||||||
ARG FETCH_MAC_OS_RAW=https://raw.githubusercontent.com/acidanthera/OpenCorePkg/master/Utilities/macrecovery/macrecovery.py
|
&& rm ./BaseSystem.dmg
|
||||||
# submit a PR to here to get the version option https://github.com/acidanthera/OpenCorePkg/blob/master/Utilities/macrecovery/macrecovery.py
|
|
||||||
|
|
||||||
RUN [[ "${VERSION%%.*}" -ge 11 ]] && { wget "${FETCH_MAC_OS_RAW}" \
|
|
||||||
&& python macrecovery.py download \
|
|
||||||
&& qemu-img convert BaseSystem.dmg -O qcow2 -p -c BaseSystem.img \
|
|
||||||
&& qemu-img create -f qcow2 mac_hdd_ng.img "${SIZE}" \
|
|
||||||
&& rm -f BaseSystem.dmg \
|
|
||||||
; } || true
|
|
||||||
|
|
||||||
WORKDIR /home/arch/OSX-KVM
|
|
||||||
|
|
||||||
ARG LINUX=true
|
ARG LINUX=true
|
||||||
|
|
||||||
@ -200,10 +184,10 @@ RUN touch Launch.sh \
|
|||||||
&& tee -a Launch.sh <<< '-smbios type=2 \' \
|
&& 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 <<< '-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 <<< '-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-Catalina/OpenCore.qcow2} \' \
|
&& 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 <<< '-device ide-hd,bus=sata.2,drive=OpenCoreBoot \' \
|
&& 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 <<< '-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=qcow2 \' \
|
&& tee -a Launch.sh <<< '-drive id=InstallMedia,if=none,file=/home/arch/OSX-KVM/BaseSystem.img,format=${BASESYSTEM_FORMAT} \' \
|
||||||
&& 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=MacHDD,if=none,file=${IMAGE_PATH:-/home/arch/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 <<< '-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 <<< '-netdev user,id=net0,hostfwd=tcp::${INTERNAL_SSH_PORT:-10022}-:22,hostfwd=tcp::${SCREEN_SHARE_PORT:-5900}-:5900,${ADDITIONAL_PORTS} \' \
|
||||||
@ -216,33 +200,52 @@ RUN touch Launch.sh \
|
|||||||
# docker exec containerid mv ./Launch-nopicker.sh ./Launch.sh
|
# docker exec containerid mv ./Launch-nopicker.sh ./Launch.sh
|
||||||
# This is now a legacy command.
|
# This is now a legacy command.
|
||||||
# You can use -e BOOTDISK=/bootdisk with -v ./bootdisk.img:/bootdisk
|
# You can use -e BOOTDISK=/bootdisk with -v ./bootdisk.img:/bootdisk
|
||||||
|
|
||||||
|
### LEGACY CODE
|
||||||
RUN grep -v InstallMedia ./Launch.sh > ./Launch-nopicker.sh \
|
RUN grep -v InstallMedia ./Launch.sh > ./Launch-nopicker.sh \
|
||||||
&& chmod +x ./Launch-nopicker.sh \
|
&& chmod +x ./Launch-nopicker.sh \
|
||||||
&& sed -i -e s/OpenCore\.qcow2/OpenCore\-nopicker\.qcow2/ ./Launch-nopicker.sh
|
&& sed -i -e s/OpenCore\.qcow2/OpenCore\-nopicker\.qcow2/ ./Launch-nopicker.sh
|
||||||
|
###
|
||||||
|
|
||||||
USER arch
|
USER arch
|
||||||
|
|
||||||
ENV USER arch
|
ENV USER arch
|
||||||
|
|
||||||
# 5.13 problem
|
#### libguestfs versioning
|
||||||
|
|
||||||
|
# 5.13+ problem resolved by building the qcow2 against 5.12 using libguestfs-1.44.1-6
|
||||||
|
|
||||||
ENV SUPERMIN_KERNEL=/boot/vmlinuz-linux
|
ENV SUPERMIN_KERNEL=/boot/vmlinuz-linux
|
||||||
|
|
||||||
ENV SUPERMIN_MODULES=/lib/modules/5.12.14-arch1-1
|
ENV SUPERMIN_MODULES=/lib/modules/5.12.14-arch1-1
|
||||||
|
|
||||||
ENV SUPERMIN_KERNEL_VERSION=5.12.14-arch1-1
|
ENV SUPERMIN_KERNEL_VERSION=5.12.14-arch1-1
|
||||||
|
ENV KERNEL_PACKAGE_URL=https://archive.archlinux.org/packages/l/linux/linux-5.12.14.arch1-1-x86_64.pkg.tar.zst
|
||||||
|
ENV KERNEL_HEADERS_PACKAGE_URL=https://archive.archlinux.org/packages/l/linux/linux-headers-5.12.14.arch1-1-x86_64.pkg.tar.zst
|
||||||
|
ENV LIBGUESTFS_PACKAGE_URL=https://archive.archlinux.org/packages/l/libguestfs/libguestfs-1.44.1-6-x86_64.pkg.tar.zst
|
||||||
|
|
||||||
RUN sudo pacman -Rns linux --noconfirm \
|
# fix ad hoc errors from using the arch museum to get libguestfs
|
||||||
; sudo pacman -Syy \
|
RUN sudo sed -i -e 's/^\#RemoteFileSigLevel/RemoteFileSigLevel/g' /etc/pacman.conf
|
||||||
|
|
||||||
|
RUN sudo pacman -Syy \
|
||||||
|
&& sudo pacman -Rns linux --noconfirm \
|
||||||
; sudo pacman -S mkinitcpio --noconfirm \
|
; sudo pacman -S mkinitcpio --noconfirm \
|
||||||
; sudo pacman -U https://archive.archlinux.org/packages/l/linux/linux-5.12.14.arch1-1-x86_64.pkg.tar.zst --noconfirm \
|
&& sudo pacman -U "${KERNEL_PACKAGE_URL}" --noconfirm || exit 1 \
|
||||||
; sudo rm -rf /var/tmp/.guestfs-* \
|
&& sudo pacman -U "${LIBGUESTFS_PACKAGE_URL}" --noconfirm || exit 1 \
|
||||||
; libguestfs-test-tool
|
&& rm -rf /var/tmp/.guestfs-* \
|
||||||
|
&& yes | sudo pacman -Scc \
|
||||||
|
&& libguestfs-test-tool || exit 1 \
|
||||||
|
&& rm -rf /var/tmp/.guestfs-*
|
||||||
|
|
||||||
|
####
|
||||||
|
|
||||||
# These are hardcoded serials for non-iMessage related research
|
# These are hardcoded serials for non-iMessage related research
|
||||||
# Overwritten by using GENERATE_UNIQUE=true
|
# Overwritten by using GENERATE_UNIQUE=true
|
||||||
# Upstream removed nopicker, so we are adding it back in, at build time
|
# Upstream removed nopicker, so we are adding it back in, at build time
|
||||||
# Once again, this is just for the Docker build so there is a default nopicker image there
|
# Once again, this is just for the Docker build so there is a default nopicker image there
|
||||||
|
|
||||||
|
# libguestfs verbose
|
||||||
|
ENV LIBGUESTFS_DEBUG=1
|
||||||
|
ENV LIBGUESTFS_TRACE=1
|
||||||
|
|
||||||
ARG STOCK_DEVICE_MODEL=iMacPro1,1
|
ARG STOCK_DEVICE_MODEL=iMacPro1,1
|
||||||
ARG STOCK_SERIAL=C02TM2ZBHX87
|
ARG STOCK_SERIAL=C02TM2ZBHX87
|
||||||
ARG STOCK_BOARD_SERIAL=C02717306J9JG361M
|
ARG STOCK_BOARD_SERIAL=C02717306J9JG361M
|
||||||
@ -252,8 +255,8 @@ ARG STOCK_WIDTH=1920
|
|||||||
ARG STOCK_HEIGHT=1080
|
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=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_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-Catalina/OpenCore.qcow2
|
ARG STOCK_BOOTDISK=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2
|
||||||
ARG STOCK_BOOTDISK_NOPICKER=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore-nopicker.qcow2
|
ARG STOCK_BOOTDISK_NOPICKER=/home/arch/OSX-KVM/OpenCore/OpenCore-nopicker.qcow2
|
||||||
|
|
||||||
RUN ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \
|
RUN ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \
|
||||||
--master-plist-url="${STOCK_MASTER_PLIST_URL}" \
|
--master-plist-url="${STOCK_MASTER_PLIST_URL}" \
|
||||||
@ -264,8 +267,8 @@ RUN ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \
|
|||||||
--mac-address "${STOCK_MAC_ADDRESS}" \
|
--mac-address "${STOCK_MAC_ADDRESS}" \
|
||||||
--width "${STOCK_WIDTH}" \
|
--width "${STOCK_WIDTH}" \
|
||||||
--height "${STOCK_HEIGHT}" \
|
--height "${STOCK_HEIGHT}" \
|
||||||
--output-bootdisk "${STOCK_BOOTDISK}"
|
--output-bootdisk "${STOCK_BOOTDISK}" || exit 1 \
|
||||||
|
; rm -rf /var/tmp/.guestfs-*
|
||||||
|
|
||||||
RUN ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \
|
RUN ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \
|
||||||
--master-plist-url="${STOCK_MASTER_PLIST_URL_NOPICKER}" \
|
--master-plist-url="${STOCK_MASTER_PLIST_URL_NOPICKER}" \
|
||||||
@ -276,14 +279,23 @@ RUN ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \
|
|||||||
--mac-address "${STOCK_MAC_ADDRESS}" \
|
--mac-address "${STOCK_MAC_ADDRESS}" \
|
||||||
--width "${STOCK_WIDTH}" \
|
--width "${STOCK_WIDTH}" \
|
||||||
--height "${STOCK_HEIGHT}" \
|
--height "${STOCK_HEIGHT}" \
|
||||||
--output-bootdisk "${STOCK_BOOTDISK_NOPICKER}"
|
--output-bootdisk "${STOCK_BOOTDISK_NOPICKER}" || exit 1 \
|
||||||
|
; 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
|
||||||
|
####
|
||||||
|
|
||||||
#### SPECIAL RUNTIME ARGUMENTS BELOW
|
#### SPECIAL RUNTIME ARGUMENTS BELOW
|
||||||
|
|
||||||
# env -e ADDITIONAL_PORTS with a comma
|
# env -e ADDITIONAL_PORTS with a comma
|
||||||
# for example, -e ADDITIONAL_PORTS=hostfwd=tcp::23-:23,
|
# for example, -e ADDITIONAL_PORTS=hostfwd=tcp::23-:23,
|
||||||
ENV ADDITIONAL_PORTS=
|
ENV ADDITIONAL_PORTS=
|
||||||
|
|
||||||
|
# since the Makefile uses raw, and raw uses the full disk amount
|
||||||
|
# we want to use a compressed qcow2
|
||||||
|
# ENV BASESYSTEM_FORMAT=raw
|
||||||
|
ENV BASESYSTEM_FORMAT=qcow2
|
||||||
|
|
||||||
# add additional QEMU boot arguments
|
# add additional QEMU boot arguments
|
||||||
ENV BOOT_ARGS=
|
ENV BOOT_ARGS=
|
||||||
|
|
||||||
@ -327,10 +339,6 @@ ENV RAM=3
|
|||||||
ENV WIDTH=1920
|
ENV WIDTH=1920
|
||||||
ENV HEIGHT=1080
|
ENV HEIGHT=1080
|
||||||
|
|
||||||
# libguestfs verbose
|
|
||||||
ENV LIBGUESTFS_DEBUG=1
|
|
||||||
ENV LIBGUESTFS_TRACE=1
|
|
||||||
|
|
||||||
VOLUME ["/tmp/.X11-unix"]
|
VOLUME ["/tmp/.X11-unix"]
|
||||||
|
|
||||||
# check if /image is a disk image or a directory. This allows you to optionally use -v disk.img:/image
|
# check if /image is a disk image or a directory. This allows you to optionally use -v disk.img:/image
|
||||||
@ -349,16 +357,16 @@ VOLUME ["/tmp/.X11-unix"]
|
|||||||
# /bootdisk is a useful persistent place to store the 15Mb serial number bootdisk.
|
# /bootdisk is a useful persistent place to store the 15Mb serial number bootdisk.
|
||||||
|
|
||||||
# if you don't set any of the above:
|
# if you don't set any of the above:
|
||||||
# the default serial numbers are already contained in ./OpenCore-Catalina/OpenCore.qcow2
|
# the default serial numbers are already contained in ./OpenCore/OpenCore.qcow2
|
||||||
# And the default serial numbers
|
# And the default serial numbers
|
||||||
|
|
||||||
CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \
|
CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \
|
||||||
; sudo chown -R $(id -u):$(id -g) /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \
|
; sudo chown -R $(id -u):$(id -g) /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \
|
||||||
; [[ "${NOPICKER}" == true ]] && { \
|
; [[ "${NOPICKER}" == true ]] && { \
|
||||||
sed -i '/^.*InstallMedia.*/d' Launch.sh \
|
sed -i '/^.*InstallMedia.*/d' Launch.sh \
|
||||||
&& export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore-nopicker.qcow2}" \
|
&& export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore-nopicker.qcow2}" \
|
||||||
; } \
|
; } \
|
||||||
|| export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \
|
|| export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
|
||||||
; [[ "${GENERATE_UNIQUE}" == true ]] && { \
|
; [[ "${GENERATE_UNIQUE}" == true ]] && { \
|
||||||
./Docker-OSX/osx-serial-generator/generate-unique-machine-values.sh \
|
./Docker-OSX/osx-serial-generator/generate-unique-machine-values.sh \
|
||||||
--master-plist-url="${MASTER_PLIST_URL}" \
|
--master-plist-url="${MASTER_PLIST_URL}" \
|
||||||
@ -367,7 +375,7 @@ CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/n
|
|||||||
--bootdisks \
|
--bootdisks \
|
||||||
--width "${WIDTH:-1920}" \
|
--width "${WIDTH:-1920}" \
|
||||||
--height "${HEIGHT:-1080}" \
|
--height "${HEIGHT:-1080}" \
|
||||||
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \
|
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
|
||||||
--output-env "${ENV:=/env}" \
|
--output-env "${ENV:=/env}" \
|
||||||
|| exit 1 ; } \
|
|| exit 1 ; } \
|
||||||
; [[ "${GENERATE_SPECIFIC}" == true ]] && { \
|
; [[ "${GENERATE_SPECIFIC}" == true ]] && { \
|
||||||
@ -381,7 +389,7 @@ CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/n
|
|||||||
--mac-address "${MAC_ADDRESS}" \
|
--mac-address "${MAC_ADDRESS}" \
|
||||||
--width "${WIDTH:-1920}" \
|
--width "${WIDTH:-1920}" \
|
||||||
--height "${HEIGHT:-1080}" \
|
--height "${HEIGHT:-1080}" \
|
||||||
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \
|
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
|
||||||
|| exit 1 ; } \
|
|| exit 1 ; } \
|
||||||
; ./enable-ssh.sh && /bin/bash -c ./Launch.sh
|
; ./enable-ssh.sh && /bin/bash -c ./Launch.sh
|
||||||
|
|
||||||
|
@ -92,19 +92,33 @@ USER arch
|
|||||||
|
|
||||||
ENV USER arch
|
ENV USER arch
|
||||||
|
|
||||||
# 5.13 problem
|
|
||||||
|
#### libguestfs versioning
|
||||||
|
|
||||||
|
# 5.13+ problem resolved by building the qcow2 against 5.12 using libguestfs-1.44.1-6
|
||||||
|
|
||||||
ENV SUPERMIN_KERNEL=/boot/vmlinuz-linux
|
ENV SUPERMIN_KERNEL=/boot/vmlinuz-linux
|
||||||
|
|
||||||
ENV SUPERMIN_MODULES=/lib/modules/5.12.14-arch1-1
|
ENV SUPERMIN_MODULES=/lib/modules/5.12.14-arch1-1
|
||||||
|
|
||||||
ENV SUPERMIN_KERNEL_VERSION=5.12.14-arch1-1
|
ENV SUPERMIN_KERNEL_VERSION=5.12.14-arch1-1
|
||||||
|
ENV KERNEL_PACKAGE_URL=https://archive.archlinux.org/packages/l/linux/linux-5.12.14.arch1-1-x86_64.pkg.tar.zst
|
||||||
|
ENV KERNEL_HEADERS_PACKAGE_URL=https://archive.archlinux.org/packages/l/linux/linux-headers-5.12.14.arch1-1-x86_64.pkg.tar.zst
|
||||||
|
ENV LIBGUESTFS_PACKAGE_URL=https://archive.archlinux.org/packages/l/libguestfs/libguestfs-1.44.1-6-x86_64.pkg.tar.zst
|
||||||
|
|
||||||
RUN sudo pacman -Rns linux --noconfirm \
|
# fix ad hoc errors from using the arch museum to get libguestfs
|
||||||
; sudo pacman -Syy \
|
RUN sudo sed -i -e 's/^\#RemoteFileSigLevel/RemoteFileSigLevel/g' /etc/pacman.conf
|
||||||
|
|
||||||
|
RUN sudo pacman -Syy \
|
||||||
|
&& sudo pacman -Rns linux --noconfirm \
|
||||||
; sudo pacman -S mkinitcpio --noconfirm \
|
; sudo pacman -S mkinitcpio --noconfirm \
|
||||||
; sudo pacman -U https://archive.archlinux.org/packages/l/linux/linux-5.12.14.arch1-1-x86_64.pkg.tar.zst --noconfirm \
|
&& sudo pacman -U "${KERNEL_PACKAGE_URL}" --noconfirm || exit 1 \
|
||||||
; sudo rm -rf /var/tmp/.guestfs-* \
|
&& sudo pacman -U "${LIBGUESTFS_PACKAGE_URL}" --noconfirm || exit 1 \
|
||||||
; libguestfs-test-tool
|
&& rm -rf /var/tmp/.guestfs-* \
|
||||||
|
&& yes | sudo pacman -Scc \
|
||||||
|
&& libguestfs-test-tool || exit 1 \
|
||||||
|
&& rm -rf /var/tmp/.guestfs-*
|
||||||
|
|
||||||
|
####
|
||||||
|
|
||||||
|
|
||||||
WORKDIR /home/arch/OSX-KVM
|
WORKDIR /home/arch/OSX-KVM
|
||||||
|
|
||||||
@ -135,6 +149,14 @@ RUN if [[ "${COMPLETE}" ]]; then \
|
|||||||
&& wget ${WGET_OPTIONS} -O /home/arch/OSX-KVM/mac_hdd_ng.img "${IMAGE_URL}" \
|
&& wget ${WGET_OPTIONS} -O /home/arch/OSX-KVM/mac_hdd_ng.img "${IMAGE_URL}" \
|
||||||
; fi
|
; fi
|
||||||
|
|
||||||
|
|
||||||
|
####
|
||||||
|
|
||||||
|
# symlink the old directory, for redundancy
|
||||||
|
RUN ln -s /home/arch/OSX-KVM/OpenCore /home/arch/OSX-KVM/OpenCore-Catalina || true
|
||||||
|
|
||||||
|
####
|
||||||
|
|
||||||
#### SPECIAL RUNTIME ARGUMENTS BELOW
|
#### SPECIAL RUNTIME ARGUMENTS BELOW
|
||||||
|
|
||||||
ENV ADDITIONAL_PORTS=
|
ENV ADDITIONAL_PORTS=
|
||||||
@ -200,9 +222,9 @@ CMD echo "${BOILERPLATE}" \
|
|||||||
; sudo chown -R $(id -u):$(id -g) /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \
|
; sudo chown -R $(id -u):$(id -g) /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \
|
||||||
; [[ "${NOPICKER}" == true ]] && { \
|
; [[ "${NOPICKER}" == true ]] && { \
|
||||||
sed -i '/^.*InstallMedia.*/d' Launch.sh \
|
sed -i '/^.*InstallMedia.*/d' Launch.sh \
|
||||||
&& export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore-nopicker.qcow2}" \
|
&& export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore-nopicker.qcow2}" \
|
||||||
; } \
|
; } \
|
||||||
|| export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \
|
|| export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
|
||||||
; [[ "${GENERATE_UNIQUE}" == true ]] && { \
|
; [[ "${GENERATE_UNIQUE}" == true ]] && { \
|
||||||
./Docker-OSX/osx-serial-generator/generate-unique-machine-values.sh \
|
./Docker-OSX/osx-serial-generator/generate-unique-machine-values.sh \
|
||||||
--master-plist-url="${MASTER_PLIST_URL}" \
|
--master-plist-url="${MASTER_PLIST_URL}" \
|
||||||
@ -211,7 +233,7 @@ CMD echo "${BOILERPLATE}" \
|
|||||||
--bootdisks \
|
--bootdisks \
|
||||||
--width "${WIDTH:-1920}" \
|
--width "${WIDTH:-1920}" \
|
||||||
--height "${HEIGHT:-1080}" \
|
--height "${HEIGHT:-1080}" \
|
||||||
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \
|
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
|
||||||
--output-env "${ENV:=/env}" \
|
--output-env "${ENV:=/env}" \
|
||||||
|| exit 1 ; } \
|
|| exit 1 ; } \
|
||||||
; [[ "${GENERATE_SPECIFIC}" == true ]] && { \
|
; [[ "${GENERATE_SPECIFIC}" == true ]] && { \
|
||||||
@ -225,7 +247,7 @@ CMD echo "${BOILERPLATE}" \
|
|||||||
--mac-address "${MAC_ADDRESS}" \
|
--mac-address "${MAC_ADDRESS}" \
|
||||||
--width "${WIDTH:-1920}" \
|
--width "${WIDTH:-1920}" \
|
||||||
--height "${HEIGHT:-1080}" \
|
--height "${HEIGHT:-1080}" \
|
||||||
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \
|
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
|
||||||
|| exit 1 ; } \
|
|| exit 1 ; } \
|
||||||
; { [[ "${DISPLAY}" = ':99' ]] || [[ "${HEADLESS}" == true ]] ; } && { \
|
; { [[ "${DISPLAY}" = ':99' ]] || [[ "${HEADLESS}" == true ]] ; } && { \
|
||||||
nohup Xvfb :99 -screen 0 1920x1080x16 \
|
nohup Xvfb :99 -screen 0 1920x1080x16 \
|
||||||
|
@ -39,13 +39,32 @@ RUN qemu-img create -f qcow2 /home/arch/OSX-KVM/mac_hdd_ng.img "${SIZE}"
|
|||||||
|
|
||||||
WORKDIR /home/arch/OSX-KVM
|
WORKDIR /home/arch/OSX-KVM
|
||||||
|
|
||||||
|
#### libguestfs versioning
|
||||||
|
|
||||||
|
# 5.13+ problem resolved by building the qcow2 against 5.12 using libguestfs-1.44.1-6
|
||||||
|
|
||||||
|
ENV SUPERMIN_KERNEL=/boot/vmlinuz-linux
|
||||||
|
ENV SUPERMIN_MODULES=/lib/modules/5.12.14-arch1-1
|
||||||
|
ENV SUPERMIN_KERNEL_VERSION=5.12.14-arch1-1
|
||||||
|
ENV KERNEL_PACKAGE_URL=https://archive.archlinux.org/packages/l/linux/linux-5.12.14.arch1-1-x86_64.pkg.tar.zst
|
||||||
|
ENV KERNEL_HEADERS_PACKAGE_URL=https://archive.archlinux.org/packages/l/linux/linux-headers-5.12.14.arch1-1-x86_64.pkg.tar.zst
|
||||||
|
ENV LIBGUESTFS_PACKAGE_URL=https://archive.archlinux.org/packages/l/libguestfs/libguestfs-1.44.1-6-x86_64.pkg.tar.zst
|
||||||
|
|
||||||
ARG LINUX=true
|
ARG LINUX=true
|
||||||
|
|
||||||
# required to use libguestfs inside a docker container, to create bootdisks for docker-osx on-the-fly
|
# required to use libguestfs inside a docker container, to create bootdisks for docker-osx on-the-fly
|
||||||
RUN if [[ "${LINUX}" == true ]]; then \
|
RUN if [[ "${LINUX}" == true ]]; then \
|
||||||
sudo pacman -Syu linux libguestfs --noconfirm \
|
sudo pacman -U "${KERNEL_PACKAGE_URL}" --noconfirm \
|
||||||
|
; sudo pacman -U "${LIBGUESTFS_PACKAGE_URL}" --noconfirm \
|
||||||
|
; sudo pacman -U "${KERNEL_HEADERS_PACKAGE_URL}" --noconfirm \
|
||||||
|
; sudo pacman -S mkinitcpio --noconfirm \
|
||||||
|
; sudo libguestfs-test-tool \
|
||||||
|
; sudo rm -rf /var/tmp/.guestfs-* \
|
||||||
; fi
|
; fi
|
||||||
|
|
||||||
|
####
|
||||||
|
|
||||||
|
|
||||||
# optional --build-arg to change branches for testing
|
# optional --build-arg to change branches for testing
|
||||||
ARG BRANCH=master
|
ARG BRANCH=master
|
||||||
ARG REPO='https://github.com/sickcodes/Docker-OSX.git'
|
ARG REPO='https://github.com/sickcodes/Docker-OSX.git'
|
||||||
@ -73,7 +92,7 @@ RUN touch Launch.sh \
|
|||||||
&& tee -a Launch.sh <<< '-smbios type=2 \' \
|
&& 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 <<< '-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 <<< '-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-Catalina/OpenCore.qcow2} \' \
|
&& 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 <<< '-device ide-hd,bus=sata.2,drive=OpenCoreBoot \' \
|
&& 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 <<< '-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=qcow2 \' \
|
&& tee -a Launch.sh <<< '-drive id=InstallMedia,if=none,file=/home/arch/OSX-KVM/BaseSystem.img,format=qcow2 \' \
|
||||||
@ -97,19 +116,32 @@ USER arch
|
|||||||
|
|
||||||
ENV USER arch
|
ENV USER arch
|
||||||
|
|
||||||
# 5.13 problem
|
|
||||||
|
#### libguestfs versioning
|
||||||
|
|
||||||
|
# 5.13+ problem resolved by building the qcow2 against 5.12 using libguestfs-1.44.1-6
|
||||||
|
|
||||||
ENV SUPERMIN_KERNEL=/boot/vmlinuz-linux
|
ENV SUPERMIN_KERNEL=/boot/vmlinuz-linux
|
||||||
|
|
||||||
ENV SUPERMIN_MODULES=/lib/modules/5.12.14-arch1-1
|
ENV SUPERMIN_MODULES=/lib/modules/5.12.14-arch1-1
|
||||||
|
|
||||||
ENV SUPERMIN_KERNEL_VERSION=5.12.14-arch1-1
|
ENV SUPERMIN_KERNEL_VERSION=5.12.14-arch1-1
|
||||||
|
ENV KERNEL_PACKAGE_URL=https://archive.archlinux.org/packages/l/linux/linux-5.12.14.arch1-1-x86_64.pkg.tar.zst
|
||||||
|
ENV KERNEL_HEADERS_PACKAGE_URL=https://archive.archlinux.org/packages/l/linux/linux-headers-5.12.14.arch1-1-x86_64.pkg.tar.zst
|
||||||
|
ENV LIBGUESTFS_PACKAGE_URL=https://archive.archlinux.org/packages/l/libguestfs/libguestfs-1.44.1-6-x86_64.pkg.tar.zst
|
||||||
|
|
||||||
RUN sudo pacman -Rns linux --noconfirm \
|
RUN sudo pacman -Syy \
|
||||||
; sudo pacman -Syy \
|
&& sudo pacman -Rns linux --noconfirm \
|
||||||
; sudo pacman -S mkinitcpio --noconfirm \
|
; sudo pacman -S mkinitcpio --noconfirm \
|
||||||
; sudo pacman -U https://archive.archlinux.org/packages/l/linux/linux-5.12.14.arch1-1-x86_64.pkg.tar.zst --noconfirm \
|
&& sudo pacman -U "${KERNEL_PACKAGE_URL}" --noconfirm \
|
||||||
; sudo rm -rf /var/tmp/.guestfs-* \
|
&& sudo pacman -U "${LIBGUESTFS_PACKAGE_URL}" --noconfirm \
|
||||||
; libguestfs-test-tool
|
&& rm -rf /var/tmp/.guestfs-* \
|
||||||
|
; libguestfs-test-tool || exit 1
|
||||||
|
|
||||||
|
####
|
||||||
|
|
||||||
|
# symlink the old directory, for redundancy
|
||||||
|
RUN ln -s /home/arch/OSX-KVM/OpenCore /home/arch/OSX-KVM/OpenCore-Catalina || true
|
||||||
|
|
||||||
|
####
|
||||||
|
|
||||||
#### SPECIAL RUNTIME ARGUMENTS BELOW
|
#### SPECIAL RUNTIME ARGUMENTS BELOW
|
||||||
|
|
||||||
@ -182,16 +214,16 @@ VOLUME ["/tmp/.X11-unix"]
|
|||||||
# /bootdisk is a useful persistent place to store the 15Mb serial number bootdisk.
|
# /bootdisk is a useful persistent place to store the 15Mb serial number bootdisk.
|
||||||
|
|
||||||
# if you don't set any of the above:
|
# if you don't set any of the above:
|
||||||
# the default serial numbers are already contained in ./OpenCore-Catalina/OpenCore.qcow2
|
# the default serial numbers are already contained in ./OpenCore/OpenCore.qcow2
|
||||||
# And the default serial numbers
|
# And the default serial numbers
|
||||||
|
|
||||||
CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \
|
CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \
|
||||||
; sudo chown -R $(id -u):$(id -g) /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \
|
; sudo chown -R $(id -u):$(id -g) /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \
|
||||||
; [[ "${NOPICKER}" == true ]] && { \
|
; [[ "${NOPICKER}" == true ]] && { \
|
||||||
sed -i '/^.*InstallMedia.*/d' Launch.sh \
|
sed -i '/^.*InstallMedia.*/d' Launch.sh \
|
||||||
&& export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore-nopicker.qcow2}" \
|
&& export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore-nopicker.qcow2}" \
|
||||||
; } \
|
; } \
|
||||||
|| export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \
|
|| export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
|
||||||
; [[ "${GENERATE_UNIQUE}" == true ]] && { \
|
; [[ "${GENERATE_UNIQUE}" == true ]] && { \
|
||||||
./Docker-OSX/osx-serial-generator/generate-unique-machine-values.sh \
|
./Docker-OSX/osx-serial-generator/generate-unique-machine-values.sh \
|
||||||
--master-plist-url="${MASTER_PLIST_URL}" \
|
--master-plist-url="${MASTER_PLIST_URL}" \
|
||||||
@ -200,7 +232,7 @@ CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/n
|
|||||||
--bootdisks \
|
--bootdisks \
|
||||||
--width "${WIDTH:-1920}" \
|
--width "${WIDTH:-1920}" \
|
||||||
--height "${HEIGHT:-1080}" \
|
--height "${HEIGHT:-1080}" \
|
||||||
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \
|
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
|
||||||
--output-env "${ENV:=/env}" \
|
--output-env "${ENV:=/env}" \
|
||||||
|| exit 1 ; } \
|
|| exit 1 ; } \
|
||||||
; [[ "${GENERATE_SPECIFIC}" == true ]] && { \
|
; [[ "${GENERATE_SPECIFIC}" == true ]] && { \
|
||||||
@ -214,7 +246,7 @@ CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/n
|
|||||||
--mac-address "${MAC_ADDRESS}" \
|
--mac-address "${MAC_ADDRESS}" \
|
||||||
--width "${WIDTH:-1920}" \
|
--width "${WIDTH:-1920}" \
|
||||||
--height "${HEIGHT:-1080}" \
|
--height "${HEIGHT:-1080}" \
|
||||||
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \
|
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
|
||||||
|| exit 1 ; } \
|
|| exit 1 ; } \
|
||||||
; ./enable-ssh.sh && /bin/bash -c ./Launch.sh
|
; ./enable-ssh.sh && /bin/bash -c ./Launch.sh
|
||||||
|
|
||||||
|
263
Dockerfile.naked
263
Dockerfile.naked
@ -30,22 +30,22 @@
|
|||||||
# docker run -it --device /dev/kvm -p 50922:10022 -v ${PWD}/mac_hdd_ng.img:/image -e "DISPLAY=${DISPLAY:-:0.0}" -v /tmp/.X11-unix:/tmp/.X11-unix docker-osx:naked
|
# docker run -it --device /dev/kvm -p 50922:10022 -v ${PWD}/mac_hdd_ng.img:/image -e "DISPLAY=${DISPLAY:-:0.0}" -v /tmp/.X11-unix:/tmp/.X11-unix docker-osx:naked
|
||||||
#
|
#
|
||||||
|
|
||||||
FROM sickcodes/docker-osx:latest
|
FROM archlinux:base-devel
|
||||||
|
LABEL maintainer='https://twitter.com/sickcodes <https://sick.codes>'
|
||||||
|
|
||||||
MAINTAINER 'https://twitter.com/sickcodes' <https://sick.codes>
|
SHELL ["/bin/bash", "-c"]
|
||||||
|
|
||||||
USER root
|
# change disk size here or add during build, e.g. --build-arg VERSION=10.14.5 --build-arg SIZE=50G
|
||||||
|
ARG SIZE=200G
|
||||||
WORKDIR /root
|
|
||||||
|
|
||||||
RUN rm -f /home/arch/OSX-KVM/mac_hdd_ng.img
|
|
||||||
|
|
||||||
# OPTIONAL: Arch Linux server mirrors for super fast builds
|
# OPTIONAL: Arch Linux server mirrors for super fast builds
|
||||||
# set RANKMIRRORS to any value other that nothing, e.g. -e RANKMIRRORS=true
|
# set RANKMIRRORS to any value other that nothing, e.g. -e RANKMIRRORS=true
|
||||||
ARG RANKMIRRORS
|
ARG RANKMIRRORS
|
||||||
ARG MIRROR_COUNTRY=US
|
ARG MIRROR_COUNTRY=US
|
||||||
ARG MIRROR_COUNT=10
|
ARG MIRROR_COUNT=10
|
||||||
RUN if [[ "${RANKMIRRORS}" ]]; then { pacman -Sy wget --noconfirm || pacman -Syu wget --noconfirm ; } \
|
|
||||||
|
RUN if [[ "${RANKMIRRORS}" ]]; then \
|
||||||
|
{ pacman -Sy wget --noconfirm || pacman -Syu wget --noconfirm ; } \
|
||||||
; wget -O ./rankmirrors "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/rankmirrors" \
|
; wget -O ./rankmirrors "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/rankmirrors" \
|
||||||
; wget -O- "https://www.archlinux.org/mirrorlist/?country=${MIRROR_COUNTRY:-US}&protocol=https&use_mirror_status=on" \
|
; wget -O- "https://www.archlinux.org/mirrorlist/?country=${MIRROR_COUNTRY:-US}&protocol=https&use_mirror_status=on" \
|
||||||
| sed -e 's/^#Server/Server/' -e '/^#/d' \
|
| sed -e 's/^#Server/Server/' -e '/^#/d' \
|
||||||
@ -57,11 +57,40 @@ RUN if [[ "${RANKMIRRORS}" ]]; then { pacman -Sy wget --noconfirm || pacman -Syu
|
|||||||
&& cat /etc/pacman.d/mirrorlist \
|
&& cat /etc/pacman.d/mirrorlist \
|
||||||
; fi
|
; fi
|
||||||
|
|
||||||
|
# This fails on hub.docker.com, useful for debugging in cloud
|
||||||
|
# RUN [[ $(egrep -c '(svm|vmx)' /proc/cpuinfo) -gt 0 ]] || { echo KVM not possible on this host && exit 1; }
|
||||||
|
|
||||||
|
# RUN tee -a /etc/pacman.conf <<< '[community-testing]' \
|
||||||
|
# && tee -a /etc/pacman.conf <<< 'Include = /etc/pacman.d/mirrorlist'
|
||||||
|
|
||||||
|
RUN pacman -Syu git zip vim nano alsa-utils openssh --noconfirm \
|
||||||
|
&& ln -s /bin/vim /bin/vi \
|
||||||
|
&& useradd arch -p arch \
|
||||||
|
&& tee -a /etc/sudoers <<< 'arch ALL=(ALL) NOPASSWD: ALL' \
|
||||||
|
&& mkdir /home/arch \
|
||||||
|
&& chown arch:arch /home/arch \
|
||||||
|
&& yes | sudo pacman -Scc
|
||||||
|
|
||||||
|
# allow ssh to container
|
||||||
|
RUN mkdir -m 700 /root/.ssh \
|
||||||
|
&& touch /root/.ssh/authorized_keys \
|
||||||
|
&& chmod 644 /root/.ssh/authorized_keys \
|
||||||
|
&& tee -a /etc/ssh/sshd_config <<< 'AllowTcpForwarding yes' \
|
||||||
|
&& tee -a /etc/ssh/sshd_config <<< 'PermitTunnel yes' \
|
||||||
|
&& tee -a /etc/ssh/sshd_config <<< 'X11Forwarding yes' \
|
||||||
|
&& tee -a /etc/ssh/sshd_config <<< 'PasswordAuthentication yes' \
|
||||||
|
&& tee -a /etc/ssh/sshd_config <<< 'PermitRootLogin yes' \
|
||||||
|
&& tee -a /etc/ssh/sshd_config <<< 'PubkeyAuthentication yes' \
|
||||||
|
&& tee -a /etc/ssh/sshd_config <<< 'HostKey /etc/ssh/ssh_host_rsa_key' \
|
||||||
|
&& tee -a /etc/ssh/sshd_config <<< 'HostKey /etc/ssh/ssh_host_ecdsa_key' \
|
||||||
|
&& tee -a /etc/ssh/sshd_config <<< 'HostKey /etc/ssh/ssh_host_ed25519_key'
|
||||||
|
|
||||||
# For taking screenshots of the Xfvb screen, useful during development.
|
# For taking screenshots of the Xfvb screen, useful during development.
|
||||||
ARG SCROT
|
ARG SCROT
|
||||||
|
|
||||||
|
# the following code only runs if --build-arg SCROT=true is used
|
||||||
RUN pacman -Syu xorg-server-xvfb wget xterm xorg-xhost xorg-xrandr sshpass --noconfirm \
|
RUN pacman -Syu xorg-server-xvfb wget xterm xorg-xhost xorg-xrandr sshpass --noconfirm \
|
||||||
&& if [[ "${SCROT}" ]]; then \
|
&& if [[ "${SCROT}" == true ]]; then \
|
||||||
pacman -Syu scrot base-devel --noconfirm \
|
pacman -Syu scrot base-devel --noconfirm \
|
||||||
&& git clone --recurse-submodules --depth 1 https://github.com/stolk/imcat.git \
|
&& git clone --recurse-submodules --depth 1 https://github.com/stolk/imcat.git \
|
||||||
&& cd imcat \
|
&& cd imcat \
|
||||||
@ -81,19 +110,173 @@ USER arch
|
|||||||
|
|
||||||
ENV USER arch
|
ENV USER arch
|
||||||
|
|
||||||
# 5.13 problem
|
# 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
|
||||||
|
|
||||||
|
WORKDIR /home/arch/OSX-KVM
|
||||||
|
|
||||||
|
RUN touch enable-ssh.sh \
|
||||||
|
&& chmod +x ./enable-ssh.sh \
|
||||||
|
&& tee -a enable-ssh.sh <<< '[[ -f /etc/ssh/ssh_host_rsa_key ]] || \' \
|
||||||
|
&& tee -a enable-ssh.sh <<< '[[ -f /etc/ssh/ssh_host_ed25519_key ]] || \' \
|
||||||
|
&& tee -a enable-ssh.sh <<< '[[ -f /etc/ssh/ssh_host_ed25519_key ]] || \' \
|
||||||
|
&& tee -a enable-ssh.sh <<< 'sudo /usr/bin/ssh-keygen -A' \
|
||||||
|
&& tee -a enable-ssh.sh <<< 'nohup sudo /usr/bin/sshd -D &'
|
||||||
|
|
||||||
|
# QEMU CONFIGURATOR
|
||||||
|
# set optional ram at runtime -e RAM=16
|
||||||
|
# set optional cores at runtime -e SMP=4 -e CORES=2
|
||||||
|
# add any additional commands in QEMU cli format -e EXTRA="-usb -device usb-host,hostbus=1,hostaddr=8"
|
||||||
|
|
||||||
|
# default env vars, RUNTIME ONLY, not for editing in build time.
|
||||||
|
|
||||||
|
# RUN yes | sudo pacman -Syu qemu libvirt dnsmasq virt-manager bridge-utils edk2-ovmf netctl libvirt-dbus --overwrite --noconfirm
|
||||||
|
|
||||||
|
RUN yes | sudo pacman -Syu bc qemu libvirt dnsmasq virt-manager bridge-utils openresolv jack ebtables edk2-ovmf netctl libvirt-dbus wget --overwrite --noconfirm \
|
||||||
|
&& yes | sudo pacman -Scc
|
||||||
|
|
||||||
|
WORKDIR /home/arch/OSX-KVM
|
||||||
|
|
||||||
|
# we still want a recovery disk, monterey is backwards compatible (APFS), however, the Catalina and below are not (HFS+).
|
||||||
|
ARG SHORTNAME=monterey
|
||||||
|
|
||||||
|
RUN make \
|
||||||
|
&& qemu-img convert BaseSystem.dmg -O qcow2 -p -c BaseSystem.img \
|
||||||
|
&& rm ./BaseSystem.dmg
|
||||||
|
|
||||||
|
ARG LINUX=true
|
||||||
|
|
||||||
|
# required to use libguestfs inside a docker container, to create bootdisks for docker-osx on-the-fly
|
||||||
|
RUN if [[ "${LINUX}" == true ]]; then \
|
||||||
|
sudo pacman -Syu linux libguestfs --noconfirm \
|
||||||
|
&& yes | sudo pacman -Scc \
|
||||||
|
; fi
|
||||||
|
|
||||||
|
# optional --build-arg to change branches for testing
|
||||||
|
ARG BRANCH=master
|
||||||
|
ARG REPO='https://github.com/sickcodes/Docker-OSX.git'
|
||||||
|
# RUN git clone --recurse-submodules --depth 1 --branch "${BRANCH}" "${REPO}"
|
||||||
|
RUN git clone --recurse-submodules --depth 1 --branch "${BRANCH}" "${REPO}"
|
||||||
|
|
||||||
|
RUN touch Launch.sh \
|
||||||
|
&& chmod +x ./Launch.sh \
|
||||||
|
&& tee -a Launch.sh <<< '#!/bin/bash' \
|
||||||
|
&& tee -a Launch.sh <<< 'set -eux' \
|
||||||
|
&& tee -a Launch.sh <<< 'sudo chown $(id -u):$(id -g) /dev/kvm 2>/dev/null || true' \
|
||||||
|
&& tee -a Launch.sh <<< 'sudo chown -R $(id -u):$(id -g) /dev/snd 2>/dev/null || true' \
|
||||||
|
&& tee -a Launch.sh <<< '[[ "${RAM}" = max ]] && export RAM="$(("$(head -n1 /proc/meminfo | tr -dc "[:digit:]") / 1000000"))"' \
|
||||||
|
&& tee -a Launch.sh <<< '[[ "${RAM}" = half ]] && export RAM="$(("$(head -n1 /proc/meminfo | tr -dc "[:digit:]") / 2000000"))"' \
|
||||||
|
&& tee -a Launch.sh <<< 'sudo chown -R $(id -u):$(id -g) /dev/snd 2>/dev/null || true' \
|
||||||
|
&& tee -a Launch.sh <<< 'exec qemu-system-x86_64 -m ${RAM:-2}000 \' \
|
||||||
|
&& tee -a Launch.sh <<< '-cpu ${CPU:-Penryn},${CPUID_FLAGS:-vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check,}${BOOT_ARGS} \' \
|
||||||
|
&& tee -a Launch.sh <<< '-machine q35,${KVM-"accel=kvm:tcg"} \' \
|
||||||
|
&& 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 <<< '-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 <<< '-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} \' \
|
||||||
|
&& 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 <<< '-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} \' \
|
||||||
|
&& tee -a Launch.sh <<< '-monitor stdio \' \
|
||||||
|
&& tee -a Launch.sh <<< '-boot menu=on \' \
|
||||||
|
&& tee -a Launch.sh <<< '-vga vmware \' \
|
||||||
|
&& tee -a Launch.sh <<< '${EXTRA:-}'
|
||||||
|
|
||||||
|
# docker exec containerid mv ./Launch-nopicker.sh ./Launch.sh
|
||||||
|
# This is now a legacy command.
|
||||||
|
# You can use -e BOOTDISK=/bootdisk with -v ./bootdisk.img:/bootdisk
|
||||||
|
|
||||||
|
### LEGACY CODE
|
||||||
|
RUN grep -v InstallMedia ./Launch.sh > ./Launch-nopicker.sh \
|
||||||
|
&& chmod +x ./Launch-nopicker.sh \
|
||||||
|
&& sed -i -e s/OpenCore\.qcow2/OpenCore\-nopicker\.qcow2/ ./Launch-nopicker.sh
|
||||||
|
###
|
||||||
|
|
||||||
|
USER arch
|
||||||
|
|
||||||
|
ENV USER arch
|
||||||
|
|
||||||
|
#### libguestfs versioning
|
||||||
|
|
||||||
|
# 5.13+ problem resolved by building the qcow2 against 5.12 using libguestfs-1.44.1-6
|
||||||
|
|
||||||
ENV SUPERMIN_KERNEL=/boot/vmlinuz-linux
|
ENV SUPERMIN_KERNEL=/boot/vmlinuz-linux
|
||||||
|
|
||||||
ENV SUPERMIN_MODULES=/lib/modules/5.12.14-arch1-1
|
ENV SUPERMIN_MODULES=/lib/modules/5.12.14-arch1-1
|
||||||
|
|
||||||
ENV SUPERMIN_KERNEL_VERSION=5.12.14-arch1-1
|
ENV SUPERMIN_KERNEL_VERSION=5.12.14-arch1-1
|
||||||
|
ENV KERNEL_PACKAGE_URL=https://archive.archlinux.org/packages/l/linux/linux-5.12.14.arch1-1-x86_64.pkg.tar.zst
|
||||||
|
ENV KERNEL_HEADERS_PACKAGE_URL=https://archive.archlinux.org/packages/l/linux/linux-headers-5.12.14.arch1-1-x86_64.pkg.tar.zst
|
||||||
|
ENV LIBGUESTFS_PACKAGE_URL=https://archive.archlinux.org/packages/l/libguestfs/libguestfs-1.44.1-6-x86_64.pkg.tar.zst
|
||||||
|
|
||||||
RUN sudo pacman -Rns linux --noconfirm \
|
# fix ad hoc errors from using the arch museum to get libguestfs
|
||||||
; sudo pacman -Syy \
|
RUN sudo sed -i -e 's/^\#RemoteFileSigLevel/RemoteFileSigLevel/g' /etc/pacman.conf
|
||||||
|
|
||||||
|
RUN sudo pacman -Syy \
|
||||||
|
&& sudo pacman -Rns linux --noconfirm \
|
||||||
; sudo pacman -S mkinitcpio --noconfirm \
|
; sudo pacman -S mkinitcpio --noconfirm \
|
||||||
; sudo pacman -U https://archive.archlinux.org/packages/l/linux/linux-5.12.14.arch1-1-x86_64.pkg.tar.zst --noconfirm \
|
&& sudo pacman -U "${KERNEL_PACKAGE_URL}" --noconfirm || exit 1 \
|
||||||
; sudo rm -rf /var/tmp/.guestfs-* \
|
&& sudo pacman -U "${LIBGUESTFS_PACKAGE_URL}" --noconfirm || exit 1 \
|
||||||
; libguestfs-test-tool
|
&& rm -rf /var/tmp/.guestfs-* \
|
||||||
|
&& yes | sudo pacman -Scc \
|
||||||
|
&& libguestfs-test-tool || exit 1 \
|
||||||
|
&& rm -rf /var/tmp/.guestfs-*
|
||||||
|
|
||||||
|
####
|
||||||
|
|
||||||
|
# These are hardcoded serials for non-iMessage related research
|
||||||
|
# Overwritten by using GENERATE_UNIQUE=true
|
||||||
|
# Upstream removed nopicker, so we are adding it back in, at build time
|
||||||
|
# Once again, this is just for the Docker build so there is a default nopicker image there
|
||||||
|
|
||||||
|
# libguestfs verbose
|
||||||
|
ENV LIBGUESTFS_DEBUG=1
|
||||||
|
ENV LIBGUESTFS_TRACE=1
|
||||||
|
|
||||||
|
ARG STOCK_DEVICE_MODEL=iMacPro1,1
|
||||||
|
ARG STOCK_SERIAL=C02TM2ZBHX87
|
||||||
|
ARG STOCK_BOARD_SERIAL=C02717306J9JG361M
|
||||||
|
ARG STOCK_UUID=007076A6-F2A2-4461-BBE5-BAD019F8025A
|
||||||
|
ARG STOCK_MAC_ADDRESS=00:0A:27:00:00:00
|
||||||
|
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
|
||||||
|
|
||||||
|
RUN ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \
|
||||||
|
--master-plist-url="${STOCK_MASTER_PLIST_URL}" \
|
||||||
|
--model "${STOCK_DEVICE_MODEL}" \
|
||||||
|
--serial "${STOCK_SERIAL}" \
|
||||||
|
--board-serial "${STOCK_BOARD_SERIAL}" \
|
||||||
|
--uuid "${STOCK_UUID}" \
|
||||||
|
--mac-address "${STOCK_MAC_ADDRESS}" \
|
||||||
|
--width "${STOCK_WIDTH}" \
|
||||||
|
--height "${STOCK_HEIGHT}" \
|
||||||
|
--output-bootdisk "${STOCK_BOOTDISK}" || exit 1 \
|
||||||
|
; rm -rf /var/tmp/.guestfs-*
|
||||||
|
|
||||||
|
RUN ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \
|
||||||
|
--master-plist-url="${STOCK_MASTER_PLIST_URL_NOPICKER}" \
|
||||||
|
--model "${STOCK_DEVICE_MODEL}" \
|
||||||
|
--serial "${STOCK_SERIAL}" \
|
||||||
|
--board-serial "${STOCK_BOARD_SERIAL}" \
|
||||||
|
--uuid "${STOCK_UUID}" \
|
||||||
|
--mac-address "${STOCK_MAC_ADDRESS}" \
|
||||||
|
--width "${STOCK_WIDTH}" \
|
||||||
|
--height "${STOCK_HEIGHT}" \
|
||||||
|
--output-bootdisk "${STOCK_BOOTDISK_NOPICKER}" || exit 1 \
|
||||||
|
; rm -rf /var/tmp/.guestfs-*
|
||||||
|
|
||||||
|
|
||||||
WORKDIR /home/arch/OSX-KVM
|
WORKDIR /home/arch/OSX-KVM
|
||||||
|
|
||||||
@ -107,8 +290,13 @@ RUN mkdir -p ~/.ssh \
|
|||||||
&& tee -a ~/.ssh/config <<< ' StrictHostKeyChecking no' \
|
&& tee -a ~/.ssh/config <<< ' StrictHostKeyChecking no' \
|
||||||
&& tee -a ~/.ssh/config <<< ' UserKnownHostsFile=/dev/null'
|
&& tee -a ~/.ssh/config <<< ' UserKnownHostsFile=/dev/null'
|
||||||
|
|
||||||
#### SPECIAL RUNTIME ARGUMENTS BELOW
|
### 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
|
||||||
|
####
|
||||||
|
|
||||||
|
#### SPECIAL RUNTIME ARGUMENTS BELOW
|
||||||
|
# env -e ADDITIONAL_PORTS with a comma
|
||||||
|
# for example, -e ADDITIONAL_PORTS=hostfwd=tcp::23-:23,
|
||||||
ENV ADDITIONAL_PORTS=
|
ENV ADDITIONAL_PORTS=
|
||||||
|
|
||||||
# add additional QEMU boot arguments
|
# add additional QEMU boot arguments
|
||||||
@ -116,13 +304,13 @@ ENV BOOT_ARGS=
|
|||||||
|
|
||||||
ENV BOOTDISK=
|
ENV BOOTDISK=
|
||||||
|
|
||||||
# edit the CPU that is beign emulated
|
# edit the CPU that is being emulated
|
||||||
ENV CPU=Penryn
|
ENV CPU=Penryn
|
||||||
|
ENV CPUID_FLAGS='vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check,'
|
||||||
|
|
||||||
ENV DISPLAY=:99
|
ENV DISPLAY=:0.0
|
||||||
|
|
||||||
ENV HEADLESS=false
|
|
||||||
|
|
||||||
|
# Deprecated
|
||||||
ENV ENV=/env
|
ENV ENV=/env
|
||||||
|
|
||||||
# Boolean for generating a bootdisk with new random serials.
|
# Boolean for generating a bootdisk with new random serials.
|
||||||
@ -153,9 +341,26 @@ ENV RAM=3
|
|||||||
ENV WIDTH=1920
|
ENV WIDTH=1920
|
||||||
ENV HEIGHT=1080
|
ENV HEIGHT=1080
|
||||||
|
|
||||||
# libguestfs verbose
|
VOLUME ["/tmp/.X11-unix"]
|
||||||
ENV LIBGUESTFS_DEBUG=1
|
|
||||||
ENV LIBGUESTFS_TRACE=1
|
# check if /image is a disk image or a directory. This allows you to optionally use -v disk.img:/image
|
||||||
|
# NOPICKER is used to skip the disk selection screen
|
||||||
|
# GENERATE_UNIQUE is used to generate serial numbers on boot.
|
||||||
|
# /env is a file that you can generate and save using -v source.sh:/env
|
||||||
|
# the env file is a file that you can carry to the next container which will supply the serials numbers.
|
||||||
|
# GENERATE_SPECIFIC is used to either accept the env serial numbers OR you can supply using:
|
||||||
|
# -e DEVICE_MODEL="iMacPro1,1" \
|
||||||
|
# -e SERIAL="C02TW0WAHX87" \
|
||||||
|
# -e BOARD_SERIAL="C027251024NJG36UE" \
|
||||||
|
# -e UUID="5CCB366D-9118-4C61-A00A-E5BAF3BED451" \
|
||||||
|
# -e MAC_ADDRESS="A8:5C:2C:9A:46:2F" \
|
||||||
|
|
||||||
|
# the output will be /bootdisk.
|
||||||
|
# /bootdisk is a useful persistent place to store the 15Mb serial number bootdisk.
|
||||||
|
|
||||||
|
# if you don't set any of the above:
|
||||||
|
# the default serial numbers are already contained in ./OpenCore/OpenCore.qcow2
|
||||||
|
# And the default serial numbers
|
||||||
|
|
||||||
CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \
|
CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \
|
||||||
; sudo chown -R $(id -u):$(id -g) /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \
|
; sudo chown -R $(id -u):$(id -g) /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \
|
||||||
@ -165,9 +370,9 @@ CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/n
|
|||||||
; } \
|
; } \
|
||||||
; [[ "${NOPICKER}" == true ]] && { \
|
; [[ "${NOPICKER}" == true ]] && { \
|
||||||
sed -i '/^.*InstallMedia.*/d' Launch.sh \
|
sed -i '/^.*InstallMedia.*/d' Launch.sh \
|
||||||
&& export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore-nopicker.qcow2}" \
|
&& export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore-nopicker.qcow2}" \
|
||||||
; } \
|
; } \
|
||||||
|| export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \
|
|| export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
|
||||||
; [[ "${GENERATE_UNIQUE}" == true ]] && { \
|
; [[ "${GENERATE_UNIQUE}" == true ]] && { \
|
||||||
./Docker-OSX/osx-serial-generator/generate-unique-machine-values.sh \
|
./Docker-OSX/osx-serial-generator/generate-unique-machine-values.sh \
|
||||||
--master-plist-url="${MASTER_PLIST_URL}" \
|
--master-plist-url="${MASTER_PLIST_URL}" \
|
||||||
@ -176,7 +381,7 @@ CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/n
|
|||||||
--bootdisks \
|
--bootdisks \
|
||||||
--width "${WIDTH:-1920}" \
|
--width "${WIDTH:-1920}" \
|
||||||
--height "${HEIGHT:-1080}" \
|
--height "${HEIGHT:-1080}" \
|
||||||
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \
|
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
|
||||||
--output-env "${ENV:=/env}" \
|
--output-env "${ENV:=/env}" \
|
||||||
|| exit 1 ; } \
|
|| exit 1 ; } \
|
||||||
; [[ "${GENERATE_SPECIFIC}" == true ]] && { \
|
; [[ "${GENERATE_SPECIFIC}" == true ]] && { \
|
||||||
@ -190,6 +395,6 @@ CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/n
|
|||||||
--mac-address "${MAC_ADDRESS}" \
|
--mac-address "${MAC_ADDRESS}" \
|
||||||
--width "${WIDTH:-1920}" \
|
--width "${WIDTH:-1920}" \
|
||||||
--height "${HEIGHT:-1080}" \
|
--height "${HEIGHT:-1080}" \
|
||||||
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \
|
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
|
||||||
|| exit 1 ; } \
|
|| exit 1 ; } \
|
||||||
; ./enable-ssh.sh && /bin/bash -c ./Launch.sh
|
; ./enable-ssh.sh && /bin/bash -c ./Launch.sh
|
||||||
|
@ -73,19 +73,32 @@ USER arch
|
|||||||
|
|
||||||
ENV USER arch
|
ENV USER arch
|
||||||
|
|
||||||
# 5.13 problem
|
#### libguestfs versioning
|
||||||
|
|
||||||
|
# 5.13+ problem resolved by building the qcow2 against 5.12 using libguestfs-1.44.1-6
|
||||||
|
|
||||||
ENV SUPERMIN_KERNEL=/boot/vmlinuz-linux
|
ENV SUPERMIN_KERNEL=/boot/vmlinuz-linux
|
||||||
|
|
||||||
ENV SUPERMIN_MODULES=/lib/modules/5.12.14-arch1-1
|
ENV SUPERMIN_MODULES=/lib/modules/5.12.14-arch1-1
|
||||||
|
|
||||||
ENV SUPERMIN_KERNEL_VERSION=5.12.14-arch1-1
|
ENV SUPERMIN_KERNEL_VERSION=5.12.14-arch1-1
|
||||||
|
ENV KERNEL_PACKAGE_URL=https://archive.archlinux.org/packages/l/linux/linux-5.12.14.arch1-1-x86_64.pkg.tar.zst
|
||||||
|
ENV KERNEL_HEADERS_PACKAGE_URL=https://archive.archlinux.org/packages/l/linux/linux-headers-5.12.14.arch1-1-x86_64.pkg.tar.zst
|
||||||
|
ENV LIBGUESTFS_PACKAGE_URL=https://archive.archlinux.org/packages/l/libguestfs/libguestfs-1.44.1-6-x86_64.pkg.tar.zst
|
||||||
|
|
||||||
RUN sudo pacman -Rns linux --noconfirm \
|
# fix ad hoc errors from using the arch museum to get libguestfs
|
||||||
; sudo pacman -Syy \
|
RUN sudo sed -i -e 's/^\#RemoteFileSigLevel/RemoteFileSigLevel/g' /etc/pacman.conf
|
||||||
|
|
||||||
|
RUN sudo pacman -Syy \
|
||||||
|
&& sudo pacman -Rns linux --noconfirm \
|
||||||
; sudo pacman -S mkinitcpio --noconfirm \
|
; sudo pacman -S mkinitcpio --noconfirm \
|
||||||
; sudo pacman -U https://archive.archlinux.org/packages/l/linux/linux-5.12.14.arch1-1-x86_64.pkg.tar.zst --noconfirm \
|
&& sudo pacman -U "${KERNEL_PACKAGE_URL}" --noconfirm || exit 1 \
|
||||||
; sudo rm -rf /var/tmp/.guestfs-* \
|
&& sudo pacman -U "${LIBGUESTFS_PACKAGE_URL}" --noconfirm || exit 1 \
|
||||||
; libguestfs-test-tool
|
&& rm -rf /var/tmp/.guestfs-* \
|
||||||
|
&& yes | sudo pacman -Scc \
|
||||||
|
&& libguestfs-test-tool || exit 1 \
|
||||||
|
&& rm -rf /var/tmp/.guestfs-*
|
||||||
|
|
||||||
|
####
|
||||||
|
|
||||||
|
|
||||||
WORKDIR /home/arch/OSX-KVM
|
WORKDIR /home/arch/OSX-KVM
|
||||||
|
|
||||||
@ -116,6 +129,13 @@ RUN if [[ "${COMPLETE}" ]]; then \
|
|||||||
&& wget ${WGET_OPTIONS} -O /home/arch/OSX-KVM/mac_hdd_ng.img "${IMAGE_URL}" \
|
&& wget ${WGET_OPTIONS} -O /home/arch/OSX-KVM/mac_hdd_ng.img "${IMAGE_URL}" \
|
||||||
; fi
|
; fi
|
||||||
|
|
||||||
|
####
|
||||||
|
|
||||||
|
# symlink the old directory, for redundancy
|
||||||
|
RUN ln -s /home/arch/OSX-KVM/OpenCore /home/arch/OSX-KVM/OpenCore-Catalina || true
|
||||||
|
|
||||||
|
####
|
||||||
|
|
||||||
#### SPECIAL RUNTIME ARGUMENTS BELOW
|
#### SPECIAL RUNTIME ARGUMENTS BELOW
|
||||||
|
|
||||||
ENV ADDITIONAL_PORTS=
|
ENV ADDITIONAL_PORTS=
|
||||||
@ -181,9 +201,9 @@ CMD echo "${BOILERPLATE}" \
|
|||||||
; sudo chown -R $(id -u):$(id -g) /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \
|
; sudo chown -R $(id -u):$(id -g) /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \
|
||||||
; [[ "${NOPICKER}" == true ]] && { \
|
; [[ "${NOPICKER}" == true ]] && { \
|
||||||
sed -i '/^.*InstallMedia.*/d' Launch.sh \
|
sed -i '/^.*InstallMedia.*/d' Launch.sh \
|
||||||
&& export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore-nopicker.qcow2}" \
|
&& export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore-nopicker.qcow2}" \
|
||||||
; } \
|
; } \
|
||||||
|| export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \
|
|| export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
|
||||||
; [[ "${GENERATE_UNIQUE}" == true ]] && { \
|
; [[ "${GENERATE_UNIQUE}" == true ]] && { \
|
||||||
./Docker-OSX/osx-serial-generator/generate-unique-machine-values.sh \
|
./Docker-OSX/osx-serial-generator/generate-unique-machine-values.sh \
|
||||||
--master-plist-url="${MASTER_PLIST_URL}" \
|
--master-plist-url="${MASTER_PLIST_URL}" \
|
||||||
@ -192,7 +212,7 @@ CMD echo "${BOILERPLATE}" \
|
|||||||
--bootdisks \
|
--bootdisks \
|
||||||
--width "${WIDTH:-1920}" \
|
--width "${WIDTH:-1920}" \
|
||||||
--height "${HEIGHT:-1080}" \
|
--height "${HEIGHT:-1080}" \
|
||||||
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \
|
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
|
||||||
--output-env "${ENV:=/env}" \
|
--output-env "${ENV:=/env}" \
|
||||||
|| exit 1 ; } \
|
|| exit 1 ; } \
|
||||||
; [[ "${GENERATE_SPECIFIC}" == true ]] && { \
|
; [[ "${GENERATE_SPECIFIC}" == true ]] && { \
|
||||||
@ -206,7 +226,7 @@ CMD echo "${BOILERPLATE}" \
|
|||||||
--mac-address "${MAC_ADDRESS}" \
|
--mac-address "${MAC_ADDRESS}" \
|
||||||
--width "${WIDTH:-1920}" \
|
--width "${WIDTH:-1920}" \
|
||||||
--height "${HEIGHT:-1080}" \
|
--height "${HEIGHT:-1080}" \
|
||||||
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \
|
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
|
||||||
|| exit 1 ; } \
|
|| exit 1 ; } \
|
||||||
; { [[ "${DISPLAY}" = ':99' ]] || [[ "${HEADLESS}" == true ]] ; } && { \
|
; { [[ "${DISPLAY}" = ':99' ]] || [[ "${HEADLESS}" == true ]] ; } && { \
|
||||||
nohup Xvfb :99 -screen 0 1920x1080x16 \
|
nohup Xvfb :99 -screen 0 1920x1080x16 \
|
||||||
|
136
README.md
136
README.md
@ -8,9 +8,14 @@ Run Mac OS X in Docker with near-native performance! X11 Forwarding! iMessage se
|
|||||||
|
|
||||||
The Discord is active on #docker-osx and anyone is welcome to come and ask questions, ideas, etc.
|
The Discord is active on #docker-osx and anyone is welcome to come and ask questions, ideas, etc.
|
||||||
|
|
||||||
[](https://discord.gg/mx8pPw39Yg)
|
<p align="center">
|
||||||
|
<a href="https://hub.docker.com/r/sickcodes/docker-osx"><img src="https://dockeri.co/image/sickcodes/docker-osx"/></a><a href="https://discord.gg/sickchat"><a href="https://discord.gg/sickchat" target="_blank"><img src="https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/discord-logo.svg"></a></a>
|
||||||
|
</p>
|
||||||
|
|
||||||
### Click to join the Discord server [https://discord.gg/mx8pPw39Yg](https://discord.gg/mx8pPw39Yg)
|
|
||||||
|
|
||||||
|
|
||||||
|
### Click to join the Discord server [https://discord.gg/sickchat](https://discord.gg/sickchat)
|
||||||
|
|
||||||
### Click to join the Telegram server [https://t.me/sickcodeschat](https://t.me/sickcodeschat)
|
### Click to join the Telegram server [https://t.me/sickcodeschat](https://t.me/sickcodeschat)
|
||||||
|
|
||||||
@ -34,14 +39,18 @@ Extra special thanks to the OpenCore team over at: https://github.com/acidanther
|
|||||||
|
|
||||||
If you like this project, consider contributing here or upstream!
|
If you like this project, consider contributing here or upstream!
|
||||||
|
|
||||||
<a href="https://hub.docker.com/r/sickcodes/docker-osx"><img src="https://dockeri.co/image/sickcodes/docker-osx"/></a>
|
|
||||||
|
|
||||||
## Quick Start Docker-OSX
|
## Quick Start Docker-OSX
|
||||||
|
|
||||||
|
Video setup tutorial is also available here: https://www.youtube.com/watch?v=wLezYl77Ll8
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://www.youtube.com/watch?v=wLezYl77Ll8" target="_blank"><img src="https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/Youtube-Screenshot-Docker-OSX-Setup.png"></a>
|
||||||
|
</p>
|
||||||
|
|
||||||
First time here? try [initial setup](#initial-setup), otherwise try the instructions below to use either Catalina or Big Sur.
|
First time here? try [initial setup](#initial-setup), otherwise try the instructions below to use either Catalina or Big Sur.
|
||||||
|
|
||||||
## Any questions, ideas, or just want to hang out?
|
## Any questions, ideas, or just want to hang out?
|
||||||
# [https://discord.gg/mx8pPw39Yg](https://discord.gg/mx8pPw39Yg)
|
# [https://discord.gg/sickchat](https://discord.gg/sickchat)
|
||||||
|
|
||||||
### Catalina [](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
### Catalina [](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||||
|
|
||||||
@ -65,7 +74,7 @@ docker run -it \
|
|||||||
-e "DISPLAY=${DISPLAY:-:0.0}" \
|
-e "DISPLAY=${DISPLAY:-:0.0}" \
|
||||||
sickcodes/docker-osx:big-sur
|
sickcodes/docker-osx:big-sur
|
||||||
|
|
||||||
# docker build -t docker-osx -e VERSION='Big Sur' .
|
# docker build -t docker-osx --build-arg SHORTNAME=big-sur .
|
||||||
```
|
```
|
||||||
|
|
||||||
### Monterey [](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
### Monterey [](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||||
@ -81,7 +90,7 @@ docker run -it \
|
|||||||
-e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist' \
|
-e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist' \
|
||||||
sickcodes/docker-osx:monterey
|
sickcodes/docker-osx:monterey
|
||||||
|
|
||||||
# docker build -t docker-osx -f Dockerfile.monterey .
|
# docker build -t docker-osx --build-arg SHORTNAME=monterey .
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Run Catalina Pre-Installed [](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
#### Run Catalina Pre-Installed [](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||||
@ -96,12 +105,45 @@ docker run -it \
|
|||||||
-p 50922:10022 \
|
-p 50922:10022 \
|
||||||
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||||
-e "DISPLAY=${DISPLAY:-:0.0}" \
|
-e "DISPLAY=${DISPLAY:-:0.0}" \
|
||||||
|
-e GENERATE_UNIQUE=true \
|
||||||
sickcodes/docker-osx:auto
|
sickcodes/docker-osx:auto
|
||||||
|
|
||||||
# username is user
|
# username is user
|
||||||
# passsword is alpine
|
# passsword is alpine
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Older Systems
|
||||||
|
|
||||||
|
### High Sierra [](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
|
||||||
|
docker run -it \
|
||||||
|
--device /dev/kvm \
|
||||||
|
-p 50922:10022 \
|
||||||
|
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||||
|
-e "DISPLAY=${DISPLAY:-:0.0}" \
|
||||||
|
sickcodes/docker-osx:high-sierra
|
||||||
|
|
||||||
|
# docker build -t docker-osx --build-arg SHORTNAME=high-sierra .
|
||||||
|
```
|
||||||
|
|
||||||
|
### Mojave [](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
|
||||||
|
docker run -it \
|
||||||
|
--device /dev/kvm \
|
||||||
|
-p 50922:10022 \
|
||||||
|
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||||
|
-e "DISPLAY=${DISPLAY:-:0.0}" \
|
||||||
|
sickcodes/docker-osx:mojave
|
||||||
|
|
||||||
|
# docker build -t docker-osx --build-arg SHORTNAME=mojave .
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### Download the image manually and use it in Docker
|
#### Download the image manually and use it in Docker
|
||||||
|
|
||||||
[](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
[](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||||
@ -245,31 +287,44 @@ SEE commands in [https://github.com/sickcodes/osx-optimizer](https://github.com/
|
|||||||
|
|
||||||
## Important notices:
|
## Important notices:
|
||||||
|
|
||||||
**2021-09-09** - Bootdisks at runtime required for Monterey!
|
**2021-11-14** - Added High Sierra, Mojave
|
||||||
|
|
||||||
Pick one of these:
|
Pick one of these while **building**, irrelevant when using docker pull:
|
||||||
```
|
```
|
||||||
-e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist' \
|
--build-arg SHORTNAME=high-sierra
|
||||||
|
--build-arg SHORTNAME=mojave
|
||||||
-e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-nopicker-custom.plist' \
|
--build-arg SHORTNAME=catalina
|
||||||
|
--build-arg SHORTNAME=big-sur
|
||||||
|
--build-arg SHORTNAME=monterey
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Technical details
|
## Technical details
|
||||||
|
|
||||||
There currently five images, each with different use cases (explained [below](#container-images)):
|
There currently multiple images, each with different use cases (explained [below](#container-images)):
|
||||||
|
|
||||||
|
- High Sierra
|
||||||
|
- Mojave
|
||||||
- Catalina
|
- Catalina
|
||||||
- Big Sur
|
- Big Sur
|
||||||
|
- Monterey
|
||||||
- Auto (pre-made Catalina)
|
- Auto (pre-made Catalina)
|
||||||
- Naked (use your own .img)
|
- Naked (use your own .img)
|
||||||
- Naked-Auto (user your own .img and SSH in)
|
- Naked-Auto (user your own .img and SSH in)
|
||||||
|
|
||||||
Catalina make your own image:
|
High Sierra:
|
||||||
|
|
||||||
|
[](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||||
|
|
||||||
|
Mojave:
|
||||||
|
|
||||||
|
[](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||||
|
|
||||||
|
Catalina:
|
||||||
|
|
||||||
[](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
[](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||||
|
|
||||||
Big-Sur make your own image:
|
Big-Sur:
|
||||||
|
|
||||||
[](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
[](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||||
|
|
||||||
@ -277,25 +332,26 @@ Monterey make your own image:
|
|||||||
|
|
||||||
[](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
[](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||||
|
|
||||||
Pre-made system by [Sick.Codes](https://sick.codes): username: `user`, password: `alpine`
|
Pre-made **Catalina** system by [Sick.Codes](https://sick.codes): username: `user`, password: `alpine`
|
||||||
|
|
||||||
[](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
[](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||||
|
|
||||||
Bring-your-own-image setup (use any of the above first):
|
Naked: Bring-your-own-image setup (use any of the above first):
|
||||||
|
|
||||||
[](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
[](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||||
|
|
||||||
Same as above but with `-e USERNAME` & `-e PASSWORD` and `-e OSX_COMMANDS="put your commands here"`
|
Naked Auto: same as above but with `-e USERNAME` & `-e PASSWORD` and `-e OSX_COMMANDS="put your commands here"`
|
||||||
|
|
||||||
[](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
[](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||||
|
|
||||||
## Capabilities
|
## Capabilities
|
||||||
- use iPhone OSX KVM on Linux using usbfluxd!
|
- use iPhone OSX KVM on Linux using [usbfluxd](https://github.com/corellium/usbfluxd)!
|
||||||
- macOS Monterey!
|
- macOS Monterey VM on Linux!
|
||||||
- Folder sharing
|
- Folder sharing-
|
||||||
|
- USB passthrough (hotplug too)
|
||||||
- SSH enabled (`localhost:50922`)
|
- SSH enabled (`localhost:50922`)
|
||||||
- VNC enabled (`localhost:8888`) if using ./vnc version
|
- VNC enabled (`localhost:8888`) if using ./vnc version
|
||||||
- [serial number generator!](https://github.com/sickcodes/osx-serial-generator)
|
- iMessage security research via [serial number generator!](https://github.com/sickcodes/osx-serial-generator)
|
||||||
- X11 forwarding is enabled
|
- X11 forwarding is enabled
|
||||||
- runs on top of QEMU + KVM
|
- runs on top of QEMU + KVM
|
||||||
- supports Big Sur, custom images, Xvfb headless mode
|
- supports Big Sur, custom images, Xvfb headless mode
|
||||||
@ -303,9 +359,9 @@ Same as above but with `-e USERNAME` & `-e PASSWORD` and `-e OSX_COMMANDS="put y
|
|||||||
|
|
||||||
### Requirements
|
### Requirements
|
||||||
|
|
||||||
- 20GB disk space for bare minimum installation
|
- 20GB+++ disk space for bare minimum installation (50GB if using Xcode)
|
||||||
- virtualization should be enabled in your BIOS settings
|
- virtualization should be enabled in your BIOS settings
|
||||||
- a kvm-capable host
|
- a x86_64 kvm-capable host
|
||||||
- at least 50 GBs for `:auto` (half for the base image, half for your runtime image
|
- at least 50 GBs for `:auto` (half for the base image, half for your runtime image
|
||||||
|
|
||||||
### TODO
|
### TODO
|
||||||
@ -389,6 +445,9 @@ Create your personal image using `:latest` or `big-sur`. Then, pull the image ou
|
|||||||
- `sickcodes/docker-osx:big-sur` - [I want to run Big Sur.](#quick-start-docker-osx)
|
- `sickcodes/docker-osx:big-sur` - [I want to run Big Sur.](#quick-start-docker-osx)
|
||||||
- `sickcodes/docker-osx:monterey` - [I want to run Monterey.](#quick-start-docker-osx)
|
- `sickcodes/docker-osx:monterey` - [I want to run Monterey.](#quick-start-docker-osx)
|
||||||
|
|
||||||
|
- `sickcodes/docker-osx:high-sierra` - I want to run High Sierra.
|
||||||
|
- `sickcodes/docker-osx:mojave` - I want to run Mojave.
|
||||||
|
|
||||||
## Initial setup
|
## Initial setup
|
||||||
Before you do anything else, you will need to turn on hardware virtualization in your BIOS. Precisely how will depend on your particular machine (and BIOS), but it should be straightforward.
|
Before you do anything else, you will need to turn on hardware virtualization in your BIOS. Precisely how will depend on your particular machine (and BIOS), but it should be straightforward.
|
||||||
|
|
||||||
@ -418,7 +477,7 @@ sudo modprobe kvm
|
|||||||
|
|
||||||
## Additional boot instructions for when you are [creating your container](#container-creation-examples)
|
## Additional boot instructions for when you are [creating your container](#container-creation-examples)
|
||||||
|
|
||||||
- Boot the macOS Base System
|
- Boot the macOS Base System (Press Enter)
|
||||||
|
|
||||||
- Click `Disk Utility`
|
- Click `Disk Utility`
|
||||||
|
|
||||||
@ -429,6 +488,8 @@ sudo modprobe kvm
|
|||||||
|
|
||||||
- Click `Reinstall macOS`
|
- Click `Reinstall macOS`
|
||||||
|
|
||||||
|
- The system may require multiple reboots during installation
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
### Routine checks
|
### Routine checks
|
||||||
@ -479,7 +540,9 @@ This will use all available cores; adjust accordingly to the day of the week:
|
|||||||
|
|
||||||
This will use `-smp $(nproc)`
|
This will use `-smp $(nproc)`
|
||||||
|
|
||||||
#### Confirm your user is part of the the Docker group, KVM group, libvirt group
|
### Confirm your user is part of the the Docker group, KVM group, libvirt group
|
||||||
|
|
||||||
|
#### Add yourself to the Docker group
|
||||||
|
|
||||||
If you use `sudo dockerd` or dockerd is controlled by systemd/systemctl, then you must be in the Docker group.
|
If you use `sudo dockerd` or dockerd is controlled by systemd/systemctl, then you must be in the Docker group.
|
||||||
If you are not in the Docker group:
|
If you are not in the Docker group:
|
||||||
@ -499,17 +562,17 @@ See also: [initial setup](#initial-setup).
|
|||||||
#### Is the docker daemon enabled?
|
#### Is the docker daemon enabled?
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
# run ad hoc
|
||||||
|
sudo dockerd
|
||||||
|
|
||||||
|
# or daemonize it
|
||||||
|
sudo nohup dockerd &
|
||||||
|
|
||||||
# enable it in systemd (it will persist across reboots this way)
|
# enable it in systemd (it will persist across reboots this way)
|
||||||
sudo systemctl enable --now docker
|
sudo systemctl enable --now docker
|
||||||
|
|
||||||
# or just start it as your user with systemd instead of enabling it
|
# or just start it as your user with systemd instead of enabling it
|
||||||
systemctl start docker
|
systemctl start docker
|
||||||
|
|
||||||
# or run ad hoc
|
|
||||||
sudo dockerd
|
|
||||||
|
|
||||||
# or daemonize it
|
|
||||||
sudo nohup dockerd &
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## More Questions and Answers
|
## More Questions and Answers
|
||||||
@ -873,7 +936,7 @@ docker build -t docker-osx:latest \
|
|||||||
--build-arg RANKMIRRORS=true \
|
--build-arg RANKMIRRORS=true \
|
||||||
--build-arg MIRROR_COUNTRY=US \
|
--build-arg MIRROR_COUNTRY=US \
|
||||||
--build-arg MIRROR_COUNT=10 \
|
--build-arg MIRROR_COUNT=10 \
|
||||||
--build-arg VERSION=10.15.6 \
|
--build-arg SHORTNAME=catalina \
|
||||||
--build-arg SIZE=200G .
|
--build-arg SIZE=200G .
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -1085,7 +1148,9 @@ Or tell the container to use specific ones using `-e GENERATE_SPECIFIC=true`
|
|||||||
-e MAC_ADDRESS="A8:5C:2C:9A:46:2F" \
|
-e MAC_ADDRESS="A8:5C:2C:9A:46:2F" \
|
||||||
```
|
```
|
||||||
|
|
||||||
### I'd like to run Docker-OSX with WSL2 (Windows, Ubuntu)
|
### I'd like to run Docker-OSX on Windows
|
||||||
|
|
||||||
|
Running Docker-OSX on windows is possible just in WSL2 (Windows, Ubuntu).
|
||||||
|
|
||||||
Ensure KVM is enabled and `x11-apps` is installed.
|
Ensure KVM is enabled and `x11-apps` is installed.
|
||||||
|
|
||||||
@ -1401,9 +1466,6 @@ docker run -it \
|
|||||||
# Boots in a minute or two!
|
# Boots in a minute or two!
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
```bash
|
|
||||||
|
|
||||||
OR if you have an image already and just want to log in and execute arbitrary commands:
|
OR if you have an image already and just want to log in and execute arbitrary commands:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
BIN
Youtube-Screenshot-Docker-OSX-Setup.png
Normal file
BIN
Youtube-Screenshot-Docker-OSX-Setup.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 104 KiB |
Submodule osx-serial-generator updated: 769babcc58...e9b2bf825c
BIN
tests/big-sur_master.png
Normal file
BIN
tests/big-sur_master.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 196 KiB |
67
tests/boot-images.sh
Normal file
67
tests/boot-images.sh
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Author: Sick.Codes https://twitter.com/sickcodes
|
||||||
|
# Contact: https://github.com/sickcodes, https://sick.codes
|
||||||
|
# Copyright: sickcodes (C) 2021
|
||||||
|
# License: GPLv3+
|
||||||
|
# Title: Docker-OSX (Mac on Docker)
|
||||||
|
# Repository: https://github.com/sickcodes/Docker-OSX
|
||||||
|
# Website: https://sick.codes
|
||||||
|
#
|
||||||
|
# Status: Used internally to run each image and take screenshots until they match the pngs in this folder.
|
||||||
|
#
|
||||||
|
|
||||||
|
# note to self: # to get master images, boot each image, then screen shot using DISPLAY=:99 in the test.sh script
|
||||||
|
# scrot -o high-sierra_master.png
|
||||||
|
# scrot -o mojave_master.png
|
||||||
|
# scrot -o catalina_master.png
|
||||||
|
# scrot -o big-sur_master.png
|
||||||
|
# scrot -o monterey_master.png
|
||||||
|
# pull off remote server to the tests folder
|
||||||
|
# REMOTE_SERVER=
|
||||||
|
# scp root@"${REMOTE_SERVER}":~/*_master.png .
|
||||||
|
|
||||||
|
export DISPLAY=:99
|
||||||
|
|
||||||
|
TESTS=(
|
||||||
|
high-sierra
|
||||||
|
mojave
|
||||||
|
catalina
|
||||||
|
big-sur
|
||||||
|
monterey
|
||||||
|
)
|
||||||
|
|
||||||
|
# test each docker image to see if they boot to their unique respective installation screens.
|
||||||
|
|
||||||
|
for TEST in "${TESTS[@]}"; do
|
||||||
|
# run the image detached
|
||||||
|
docker run --rm -d \
|
||||||
|
--device /dev/kvm \
|
||||||
|
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||||
|
-e "DISPLAY=:99" \
|
||||||
|
"sickcodes/docker-osx:${TEST}"
|
||||||
|
|
||||||
|
# imcat the expected test screenshot to ./"${TEST}_master.txt"
|
||||||
|
imcat ~/Docker-OSX/tests/${TEST}_master.png > ./"${TEST}_master.txt"
|
||||||
|
|
||||||
|
# run until the screen matches the expected screen
|
||||||
|
while :; do
|
||||||
|
sleep 5
|
||||||
|
# screenshot the Xvfb
|
||||||
|
scrotcat > ./"${TEST}.txt"
|
||||||
|
# diff the low res txt files created from imcat
|
||||||
|
diff "./${TEST}.txt" ./"${TEST}_master.txt" && break
|
||||||
|
scrotcat
|
||||||
|
done
|
||||||
|
|
||||||
|
# kill any containers
|
||||||
|
docker kill "$(docker ps --format "{{.ID}}")"
|
||||||
|
|
||||||
|
# ensure all containers are dead
|
||||||
|
until [[ "$(docker ps | wc -l)" = 1 ]]; do
|
||||||
|
sleep 1
|
||||||
|
docker ps | xargs docker kill
|
||||||
|
done
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
|
exit 0
|
BIN
tests/catalina_master.png
Normal file
BIN
tests/catalina_master.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 316 KiB |
BIN
tests/high-sierra_master.png
Normal file
BIN
tests/high-sierra_master.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 328 KiB |
BIN
tests/mojave_master.png
Normal file
BIN
tests/mojave_master.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 316 KiB |
BIN
tests/monterey_master.png
Normal file
BIN
tests/monterey_master.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 194 KiB |
151
tests/test.sh
151
tests/test.sh
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/docker
|
#!/usr/bin/bash
|
||||||
# ____ __ ____ ______ __
|
# ____ __ ____ ______ __
|
||||||
# / __ \____ _____/ /_____ _____/ __ \/ ___/ |/ /
|
# / __ \____ _____/ /_____ _____/ __ \/ ___/ |/ /
|
||||||
# / / / / __ \/ ___/ //_/ _ \/ ___/ / / /\__ \| /
|
# / / / / __ \/ ___/ //_/ _ \/ ___/ / / /\__ \| /
|
||||||
@ -12,7 +12,7 @@
|
|||||||
# Repository: https://github.com/sickcodes/Docker-OSX
|
# Repository: https://github.com/sickcodes/Docker-OSX
|
||||||
# Website: https://sick.codes
|
# Website: https://sick.codes
|
||||||
#
|
#
|
||||||
# Status: Work in progress.
|
# Status: Used internally to auto build, run and test images on DO.
|
||||||
#
|
#
|
||||||
|
|
||||||
help_text="Usage: ./test.sh --branch <string> --repo <string>
|
help_text="Usage: ./test.sh --branch <string> --repo <string>
|
||||||
@ -120,13 +120,17 @@ NO_CACHE="${NO_CACHE:=--no-cache}"
|
|||||||
|
|
||||||
|
|
||||||
TEST_BUILDS=(
|
TEST_BUILDS=(
|
||||||
'docker-osx:latest'
|
'docker-osx:naked'
|
||||||
'docker-osx:naked'
|
'docker-osx:naked-auto'
|
||||||
'docker-osx:naked-auto'
|
'docker-osx:auto'
|
||||||
'docker-osx:big-sur'
|
)
|
||||||
'docker-osx:monterey'
|
|
||||||
'docker-osx:auto'
|
VERSION_BUILDS=(
|
||||||
#'docker-osx:auto-big-sur'
|
'high-sierra'
|
||||||
|
'mojave'
|
||||||
|
'catalina'
|
||||||
|
'big-sur'
|
||||||
|
'monterey'
|
||||||
)
|
)
|
||||||
|
|
||||||
install_docker () {
|
install_docker () {
|
||||||
@ -174,7 +178,7 @@ install_scrotcat () {
|
|||||||
make -C ./imcat
|
make -C ./imcat
|
||||||
sudo cp ./imcat/imcat /usr/bin/imcat
|
sudo cp ./imcat/imcat /usr/bin/imcat
|
||||||
touch /usr/bin/scrotcat
|
touch /usr/bin/scrotcat
|
||||||
tee -a /usr/bin/scrotcat <<< '/usr/bin/imcat <(scrot -o /dev/stdout)'
|
tee /usr/bin/scrotcat <<< '/usr/bin/imcat <(scrot -o /dev/stdout)'
|
||||||
chmod +x /usr/bin/scrotcat
|
chmod +x /usr/bin/scrotcat
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -196,25 +200,13 @@ enable_kvm () {
|
|||||||
echo 1 | tee /sys/module/kvm/parameters/ignore_msrs
|
echo 1 | tee /sys/module/kvm/parameters/ignore_msrs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
clone_repo () {
|
clone_repo () {
|
||||||
git clone --branch="${1}" "${2}" Docker-OSX
|
git clone --branch="${1}" "${2}" Docker-OSX
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
docker-osx:latest () {
|
|
||||||
docker build ${NO_CACHE} \
|
|
||||||
--build-arg BRANCH="${BRANCH}" \
|
|
||||||
--build-arg RANKMIRRORS=true \
|
|
||||||
--build-arg MIRROR_COUNTRY="${MIRROR_COUNTRY}" \
|
|
||||||
-f ./Dockerfile \
|
|
||||||
-t docker-osx:latest .
|
|
||||||
docker tag docker-osx:latest sickcodes/docker-osx:latest
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
docker-osx:naked () {
|
docker-osx:naked () {
|
||||||
docker build ${NO_CACHE} \
|
docker build ${NO_CACHE} \
|
||||||
|
--squash \
|
||||||
--build-arg RANKMIRRORS=true \
|
--build-arg RANKMIRRORS=true \
|
||||||
--build-arg MIRROR_COUNTRY="${MIRROR_COUNTRY}" \
|
--build-arg MIRROR_COUNTRY="${MIRROR_COUNTRY}" \
|
||||||
-f ./Dockerfile.naked \
|
-f ./Dockerfile.naked \
|
||||||
@ -222,9 +214,9 @@ docker-osx:naked () {
|
|||||||
docker tag docker-osx:naked sickcodes/docker-osx:naked
|
docker tag docker-osx:naked sickcodes/docker-osx:naked
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
docker-osx:naked-auto () {
|
docker-osx:naked-auto () {
|
||||||
docker build ${NO_CACHE} \
|
docker build ${NO_CACHE} \
|
||||||
|
--squash \
|
||||||
--build-arg RANKMIRRORS=true \
|
--build-arg RANKMIRRORS=true \
|
||||||
--build-arg MIRROR_COUNTRY="${MIRROR_COUNTRY}" \
|
--build-arg MIRROR_COUNTRY="${MIRROR_COUNTRY}" \
|
||||||
-f ./Dockerfile.naked-auto \
|
-f ./Dockerfile.naked-auto \
|
||||||
@ -232,26 +224,6 @@ docker-osx:naked-auto () {
|
|||||||
docker tag docker-osx:naked-auto sickcodes/docker-osx:naked-auto
|
docker tag docker-osx:naked-auto sickcodes/docker-osx:naked-auto
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
docker-osx:big-sur () {
|
|
||||||
docker build ${NO_CACHE} \
|
|
||||||
--build-arg VERSION=11 \
|
|
||||||
--build-arg RANKMIRRORS=true \
|
|
||||||
--build-arg MIRROR_COUNTRY="${MIRROR_COUNTRY}" \
|
|
||||||
-f ./Dockerfile \
|
|
||||||
-t docker-osx:big-sur .
|
|
||||||
docker tag docker-osx:big-sur sickcodes/docker-osx:big-sur
|
|
||||||
}
|
|
||||||
|
|
||||||
docker-osx:monterey () {
|
|
||||||
docker build ${NO_CACHE} \
|
|
||||||
--build-arg RANKMIRRORS=true \
|
|
||||||
--build-arg MIRROR_COUNTRY="${MIRROR_COUNTRY}" \
|
|
||||||
-f ./Dockerfile.monterey \
|
|
||||||
-t docker-osx:monterey .
|
|
||||||
docker tag docker-osx:monterey sickcodes/docker-osx:monterey
|
|
||||||
}
|
|
||||||
|
|
||||||
docker-osx:auto () {
|
docker-osx:auto () {
|
||||||
docker build ${NO_CACHE} \
|
docker build ${NO_CACHE} \
|
||||||
--build-arg RANKMIRRORS=true \
|
--build-arg RANKMIRRORS=true \
|
||||||
@ -261,17 +233,35 @@ docker-osx:auto () {
|
|||||||
docker tag docker-osx:auto sickcodes/docker-osx:auto
|
docker tag docker-osx:auto sickcodes/docker-osx:auto
|
||||||
}
|
}
|
||||||
|
|
||||||
docker-osx:auto-big-sur () {
|
# docker-osx:auto-big-sur () {
|
||||||
|
# docker build ${NO_CACHE} \
|
||||||
|
# --build-arg RANKMIRRORS=true \
|
||||||
|
# --build-arg MIRROR_COUNTRY="${MIRROR_COUNTRY}" \
|
||||||
|
# --build-arg IMAGE_URL='https://images.sick.codes/mac_hdd_ng_auto_big_sur.img' \
|
||||||
|
# -f ./Dockerfile.auto \
|
||||||
|
# -t docker-osx:auto-big-sur .
|
||||||
|
# docker tag docker-osx:auto-big-sur sickcodes/docker-osx:auto-big-sur
|
||||||
|
# }
|
||||||
|
|
||||||
|
docker-osx:version () {
|
||||||
|
SHORTNAME="${1}"
|
||||||
docker build ${NO_CACHE} \
|
docker build ${NO_CACHE} \
|
||||||
|
--build-arg BRANCH="${BRANCH}" \
|
||||||
--build-arg RANKMIRRORS=true \
|
--build-arg RANKMIRRORS=true \
|
||||||
|
--build-arg SHORTNAME="${SHORTNAME}" \
|
||||||
--build-arg MIRROR_COUNTRY="${MIRROR_COUNTRY}" \
|
--build-arg MIRROR_COUNTRY="${MIRROR_COUNTRY}" \
|
||||||
--build-arg IMAGE_URL='https://images.sick.codes/mac_hdd_ng_auto_big_sur.img' \
|
-f ./Dockerfile \
|
||||||
-f ./Dockerfile.auto \
|
-t "docker-osx:${SHORTNAME}" .
|
||||||
-t docker-osx:auto-big-sur .
|
docker tag "docker-osx:${SHORTNAME}" "sickcodes/docker-osx:${SHORTNAME}"
|
||||||
docker tag docker-osx:auto-big-sur sickcodes/docker-osx:auto-big-sur
|
|
||||||
}
|
}
|
||||||
|
|
||||||
reset_docker_hard () {
|
reset_docker_hard () {
|
||||||
|
|
||||||
|
tee /etc/docker/daemon.json <<'EOF'
|
||||||
|
{
|
||||||
|
"experimental": true
|
||||||
|
}
|
||||||
|
EOF
|
||||||
systemctl disable --now docker
|
systemctl disable --now docker
|
||||||
systemctl disable --now docker.socket
|
systemctl disable --now docker.socket
|
||||||
systemctl stop docker
|
systemctl stop docker
|
||||||
@ -280,42 +270,47 @@ reset_docker_hard () {
|
|||||||
systemctl enable --now docker
|
systemctl enable --now docker
|
||||||
}
|
}
|
||||||
|
|
||||||
tee -a ~/.bashrc <<EOF ; true &&
|
tee -a ~/.bashrc <<EOF
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
export TZ=UTC
|
export TZ=UTC
|
||||||
EOF
|
EOF
|
||||||
export DEBIAN_FRONTEND=noninteractive \
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
; export TZ=UTC \
|
export TZ=UTC
|
||||||
; ln -snf "/usr/share/zoneinfo/${TZ}" /etc/localtime \
|
ln -snf "/usr/share/zoneinfo/${TZ}" /etc/localtime
|
||||||
; tee -a /etc/timezone <<< "${TZ}" \
|
tee -a /etc/timezone <<< "${TZ}"
|
||||||
; apt update -y \
|
apt update -y
|
||||||
; apt-get install keyboard-configuration -y \
|
apt-get install keyboard-configuration -y
|
||||||
; docker -v | grep '\ 20\.\|\ 19\.' || install_docker \
|
docker -v | grep '\ 20\.\|\ 19\.' || install_docker
|
||||||
; yes | apt install -y --no-install-recommends tzdata -y \
|
yes | apt install -y --no-install-recommends tzdata -y
|
||||||
; install_scrotcat \
|
install_scrotcat
|
||||||
; yes | install_vnc \
|
yes | install_vnc
|
||||||
; export_display_99 \
|
export_display_99
|
||||||
; echo start_xvfb \
|
start_xvfb
|
||||||
; start_vnc \
|
# start_vnc
|
||||||
; enable_kvm \
|
enable_kvm
|
||||||
; echo reset_docker_hard \
|
reset_docker_hard
|
||||||
; echo killall Xvfb \
|
echo killall Xvfb
|
||||||
; clone_repo "${BRANCH}" "${REPO}" \
|
clone_repo "${BRANCH}" "${REPO}"
|
||||||
; cd Docker-OSX \
|
cd ./Docker-OSX
|
||||||
; for TEST_BUILD in "${TEST_BUILDS[@]}"; do
|
|
||||||
|
for SHORTNAME in "${VERSION_BUILDS[@]}"; do
|
||||||
|
docker-osx:version "${SHORTNAME}"
|
||||||
|
done
|
||||||
|
|
||||||
|
docker tag docker-osx:catalina sickcodes/docker-osx:latest
|
||||||
|
|
||||||
|
for TEST_BUILD in "${TEST_BUILDS[@]}"; do
|
||||||
"${TEST_BUILD}"
|
"${TEST_BUILD}"
|
||||||
done \
|
done
|
||||||
&& touch COMPLETED
|
|
||||||
|
# boot each image and test
|
||||||
|
bash ./tests/boot-images.sh || exit 1
|
||||||
|
|
||||||
if [[ "${DOCKER_USERNAME}" ]] && [[ "${DOCKER_PASSWORD}" ]]; then
|
if [[ "${DOCKER_USERNAME}" ]] && [[ "${DOCKER_PASSWORD}" ]]; then
|
||||||
docker login --username "${DOCKER_USERNAME}" --password "${DOCKER_PASSWORD}" \
|
docker login --username "${DOCKER_USERNAME}" --password "${DOCKER_PASSWORD}" \
|
||||||
&& docker push sickcodes/docker-osx:latest \
|
&& for SHORTNAME in "${VERSION_BUILDS[@]}"; do
|
||||||
&& docker push sickcodes/docker-osx:big-sur \
|
docker push "sickcodes/docker-osx:${SHORTNAME}"
|
||||||
&& docker push sickcodes/docker-osx:monterey \
|
done \
|
||||||
&& docker push sickcodes/docker-osx:naked \
|
|
||||||
&& docker push sickcodes/docker-osx:naked-auto \
|
|
||||||
&& docker push sickcodes/docker-osx:auto \
|
|
||||||
&& docker push sickcodes/docker-osx:auto-big-sur \
|
|
||||||
&& touch PUSHED
|
&& touch PUSHED
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user