Delete Dockerfile
Browse files- Dockerfile +0 -392
Dockerfile
DELETED
|
@@ -1,392 +0,0 @@
|
|
| 1 |
-
#!/usr/bin/docker
|
| 2 |
-
# ____ __ ____ ______ __
|
| 3 |
-
# / __ \____ _____/ /_____ _____/ __ \/ ___/ |/ /
|
| 4 |
-
# / / / / __ \/ ___/ //_/ _ \/ ___/ / / /\__ \| /
|
| 5 |
-
# / /_/ / /_/ / /__/ ,< / __/ / / /_/ /___/ / |
|
| 6 |
-
# /_____/\____/\___/_/|_|\___/_/ \____//____/_/|_|
|
| 7 |
-
#
|
| 8 |
-
# Title: Docker-OSX (Mac on Docker)
|
| 9 |
-
# Author: Sick.Codes https://twitter.com/sickcodes
|
| 10 |
-
# Version: 6.0
|
| 11 |
-
# License: GPLv3+
|
| 12 |
-
# Repository: https://github.com/sickcodes/Docker-OSX
|
| 13 |
-
# Website: https://sick.codes
|
| 14 |
-
#
|
| 15 |
-
# All credits for OSX-KVM and the rest at @Kholia's repo: https://github.com/kholia/osx-kvm
|
| 16 |
-
# OpenCore support go to https://github.com/Leoyzen/KVM-Opencore
|
| 17 |
-
# and https://github.com/thenickdude/KVM-Opencore/
|
| 18 |
-
#
|
| 19 |
-
# This Dockerfile automates the installation of Docker-OSX
|
| 20 |
-
# It will build a 200GB container. You can change the size using build arguments.
|
| 21 |
-
# This Dockerfile builds on top of the work done by Dhiru Kholia, and many others.
|
| 22 |
-
#
|
| 23 |
-
# Build:
|
| 24 |
-
#
|
| 25 |
-
# docker build -t docker-osx .
|
| 26 |
-
# docker build -t docker-osx --build-arg VERSION=10.15.5 --build-arg SIZE=200G .
|
| 27 |
-
#
|
| 28 |
-
# Basic Run:
|
| 29 |
-
#
|
| 30 |
-
# docker run --device /dev/kvm --device /dev/snd -v /tmp/.X11-unix:/tmp/.X11-unix -e "DISPLAY=${DISPLAY:-:0.0}" sickcodes/docker-osx:latest
|
| 31 |
-
#
|
| 32 |
-
# Run with SSH:
|
| 33 |
-
#
|
| 34 |
-
# docker run --device /dev/kvm --device /dev/snd -e RAM=6 -p 50922:10022 -v /tmp/.X11-unix:/tmp/.X11-unix -e "DISPLAY=${DISPLAY:-:0.0}" sickcodes/docker-osx:latest
|
| 35 |
-
# # ssh fullname@localhost -p 50922
|
| 36 |
-
#
|
| 37 |
-
# Optargs:
|
| 38 |
-
#
|
| 39 |
-
# -v $PWD/disk.img:/image
|
| 40 |
-
# -e SIZE=200G
|
| 41 |
-
# -e VERSION=10.15.6
|
| 42 |
-
# -e RAM=5
|
| 43 |
-
# -e SMP=4
|
| 44 |
-
# -e CORES=4
|
| 45 |
-
# -e EXTRA=
|
| 46 |
-
# -e INTERNAL_SSH_PORT=10022
|
| 47 |
-
# -e MAC_ADDRESS=
|
| 48 |
-
#
|
| 49 |
-
# Extra QEMU args:
|
| 50 |
-
#
|
| 51 |
-
# docker run ... -e EXTRA="-usb -device usb-host,hostbus=1,hostaddr=8" ...
|
| 52 |
-
# # you will also need to pass the device to the container
|
| 53 |
-
|
| 54 |
-
FROM archlinux:base-devel
|
| 55 |
-
LABEL maintainer='https://twitter.com/sickcodes <https://sick.codes>'
|
| 56 |
-
|
| 57 |
-
SHELL ["/bin/bash", "-c"]
|
| 58 |
-
|
| 59 |
-
# change disk size here or add during build, e.g. --build-arg VERSION=10.14.5 --build-arg SIZE=50G
|
| 60 |
-
ARG SIZE=200G
|
| 61 |
-
|
| 62 |
-
# OPTIONAL: Arch Linux server mirrors for super fast builds
|
| 63 |
-
# set RANKMIRRORS to any value other that nothing, e.g. -e RANKMIRRORS=true
|
| 64 |
-
RUN perl -i -p -e s/^\#Color/Color$'\n'ParallelDownloads\ =\ 30/g /etc/pacman.conf
|
| 65 |
-
ARG RANKMIRRORS
|
| 66 |
-
ARG MIRROR_COUNTRY=US
|
| 67 |
-
ARG MIRROR_COUNT=10
|
| 68 |
-
|
| 69 |
-
RUN tee /etc/pacman.d/mirrorlist <<< 'Server = https://geo.mirror.pkgbuild.com/$repo/os/$arch' \
|
| 70 |
-
&& tee -a /etc/pacman.d/mirrorlist <<< 'Server = http://mirror.rackspace.com/archlinux/$repo/os/$arch' \
|
| 71 |
-
&& tee -a /etc/pacman.d/mirrorlist <<< 'Server = https://mirror.rackspace.com/archlinux/$repo/os/$arch'
|
| 72 |
-
|
| 73 |
-
# Fixes issue with invalid GPG keys: update the archlinux-keyring package to get the latest keys, then remove and regenerate gnupg keys
|
| 74 |
-
RUN pacman -Sy archlinux-keyring --noconfirm \
|
| 75 |
-
&& rm -rf /etc/pacman.d/gnupg \
|
| 76 |
-
&& pacman-key --init \
|
| 77 |
-
&& pacman-key --populate archlinux
|
| 78 |
-
|
| 79 |
-
RUN if [[ "${RANKMIRRORS}" ]]; then \
|
| 80 |
-
{ pacman -Sy wget --noconfirm || pacman -Syu wget --noconfirm ; } \
|
| 81 |
-
; wget -O ./rankmirrors "https://raw.githubusercontent.com/sickcodes/Docker-OSX/${BRANCH:=master}/rankmirrors" \
|
| 82 |
-
; wget -O- "https://www.archlinux.org/mirrorlist/?country=${MIRROR_COUNTRY:-US}&protocol=https&use_mirror_status=on" \
|
| 83 |
-
| sed -e 's/^#Server/Server/' -e '/^#/d' \
|
| 84 |
-
| head -n "$((${MIRROR_COUNT:-10}+1))" \
|
| 85 |
-
| bash ./rankmirrors --verbose --max-time 5 - > /etc/pacman.d/mirrorlist \
|
| 86 |
-
&& cat /etc/pacman.d/mirrorlist \
|
| 87 |
-
; fi
|
| 88 |
-
|
| 89 |
-
RUN tee -a /etc/pacman.d/gnupg/gpg.conf <<< 'keyserver hkp://keyserver.ubuntu.com' \
|
| 90 |
-
&& tee -a /etc/pacman.d/gnupg/gpg.conf <<< 'keyserver hkps://hkps.pool.sks-keyservers.net:443' \
|
| 91 |
-
&& tee -a /etc/pacman.d/gnupg/gpg.conf <<< 'keyserver hkp://pgp.mit.edu:11371' \
|
| 92 |
-
&& tee -a /etc/pacman.d/gnupg/gpg.conf <<< 'keyserver hkps://keys.openpgp.org' \
|
| 93 |
-
&& tee -a /etc/pacman.d/gnupg/gpg.conf <<< 'keyserver hkps://keys.mailvelope.com'
|
| 94 |
-
|
| 95 |
-
# This fails on hub.docker.com, useful for debugging in cloud
|
| 96 |
-
# RUN [[ $(egrep -c '(svm|vmx)' /proc/cpuinfo) -gt 0 ]] || { echo KVM not possible on this host && exit 1; }
|
| 97 |
-
|
| 98 |
-
# RUN tee -a /etc/pacman.conf <<< '[community-testing]' \
|
| 99 |
-
# && tee -a /etc/pacman.conf <<< 'Include = /etc/pacman.d/mirrorlist'
|
| 100 |
-
|
| 101 |
-
RUN pacman -Syu git zip vim nano alsa-utils openssh --noconfirm \
|
| 102 |
-
&& ln -s /bin/vim /bin/vi \
|
| 103 |
-
&& useradd arch -p arch \
|
| 104 |
-
&& tee -a /etc/sudoers <<< 'arch ALL=(ALL) NOPASSWD: ALL' \
|
| 105 |
-
&& mkdir -p /home/arch \
|
| 106 |
-
&& chown arch:arch /home/arch
|
| 107 |
-
|
| 108 |
-
# allow ssh to container
|
| 109 |
-
RUN mkdir -p -m 700 /root/.ssh
|
| 110 |
-
|
| 111 |
-
WORKDIR /root/.ssh
|
| 112 |
-
RUN touch authorized_keys \
|
| 113 |
-
&& chmod 644 authorized_keys
|
| 114 |
-
|
| 115 |
-
WORKDIR /etc/ssh
|
| 116 |
-
RUN tee -a sshd_config <<< 'AllowTcpForwarding yes' \
|
| 117 |
-
&& tee -a sshd_config <<< 'PermitTunnel yes' \
|
| 118 |
-
&& tee -a sshd_config <<< 'X11Forwarding yes' \
|
| 119 |
-
&& tee -a sshd_config <<< 'PasswordAuthentication yes' \
|
| 120 |
-
&& tee -a sshd_config <<< 'PermitRootLogin yes' \
|
| 121 |
-
&& tee -a sshd_config <<< 'PubkeyAuthentication yes' \
|
| 122 |
-
&& tee -a sshd_config <<< 'HostKey /etc/ssh/ssh_host_rsa_key' \
|
| 123 |
-
&& tee -a sshd_config <<< 'HostKey /etc/ssh/ssh_host_ecdsa_key' \
|
| 124 |
-
&& tee -a sshd_config <<< 'HostKey /etc/ssh/ssh_host_ed25519_key'
|
| 125 |
-
|
| 126 |
-
USER arch
|
| 127 |
-
|
| 128 |
-
# download OSX-KVM
|
| 129 |
-
RUN git clone --recurse-submodules --depth 1 https://github.com/kholia/OSX-KVM.git /home/arch/OSX-KVM
|
| 130 |
-
|
| 131 |
-
# enable ssh
|
| 132 |
-
# docker exec .... ./enable-ssh.sh
|
| 133 |
-
USER arch
|
| 134 |
-
|
| 135 |
-
WORKDIR /home/arch/OSX-KVM
|
| 136 |
-
|
| 137 |
-
RUN touch enable-ssh.sh \
|
| 138 |
-
&& chmod +x ./enable-ssh.sh \
|
| 139 |
-
&& tee -a enable-ssh.sh <<< '[[ -f /etc/ssh/ssh_host_rsa_key ]] || \' \
|
| 140 |
-
&& tee -a enable-ssh.sh <<< '[[ -f /etc/ssh/ssh_host_ed25519_key ]] || \' \
|
| 141 |
-
&& tee -a enable-ssh.sh <<< '[[ -f /etc/ssh/ssh_host_ed25519_key ]] || \' \
|
| 142 |
-
&& tee -a enable-ssh.sh <<< 'sudo /usr/bin/ssh-keygen -A' \
|
| 143 |
-
&& tee -a enable-ssh.sh <<< 'nohup sudo /usr/bin/sshd -D &'
|
| 144 |
-
|
| 145 |
-
# QEMU CONFIGURATOR
|
| 146 |
-
# set optional ram at runtime -e RAM=16
|
| 147 |
-
# set optional cores at runtime -e SMP=4 -e CORES=2
|
| 148 |
-
# add any additional commands in QEMU cli format -e EXTRA="-usb -device usb-host,hostbus=1,hostaddr=8"
|
| 149 |
-
|
| 150 |
-
# default env vars, RUNTIME ONLY, not for editing in build time.
|
| 151 |
-
|
| 152 |
-
# RUN yes | sudo pacman -Syu qemu libvirt dnsmasq virt-manager bridge-utils edk2-ovmf netctl libvirt-dbus --overwrite --noconfirm
|
| 153 |
-
|
| 154 |
-
RUN yes | sudo pacman -Syu bc qemu-desktop libvirt dnsmasq virt-manager bridge-utils openresolv jack2 ebtables edk2-ovmf netctl libvirt-dbus wget --overwrite --noconfirm \
|
| 155 |
-
&& yes | sudo pacman -Scc
|
| 156 |
-
|
| 157 |
-
WORKDIR /home/arch/OSX-KVM
|
| 158 |
-
|
| 159 |
-
ARG SHORTNAME=catalina
|
| 160 |
-
|
| 161 |
-
RUN make \
|
| 162 |
-
&& qemu-img convert BaseSystem.dmg -O qcow2 -p -c BaseSystem.img \
|
| 163 |
-
&& rm ./BaseSystem.dmg
|
| 164 |
-
|
| 165 |
-
# fix invalid signature on old libguestfs
|
| 166 |
-
ARG SIGLEVEL=Never
|
| 167 |
-
|
| 168 |
-
RUN sudo tee -a /etc/pacman.conf <<< "SigLevel = ${SIGLEVEL}" \
|
| 169 |
-
&& sudo tee -a /etc/pacman.conf <<< 'RemoteFileSigLevel = Optional' \
|
| 170 |
-
&& sudo sed -i -e 's/^\#RemoteFileSigLevel/RemoteFileSigLevel/g' /etc/pacman.conf
|
| 171 |
-
|
| 172 |
-
ARG LINUX=true
|
| 173 |
-
|
| 174 |
-
# required to use libguestfs inside a docker container, to create bootdisks for docker-osx on-the-fly
|
| 175 |
-
RUN if [[ "${LINUX}" == true ]]; then \
|
| 176 |
-
sudo pacman -Syu linux linux-headers archlinux-keyring guestfs-tools mkinitcpio pcre pcre2 --noconfirm \
|
| 177 |
-
&& libguestfs-test-tool \
|
| 178 |
-
&& rm -rf /var/tmp/.guestfs-* \
|
| 179 |
-
&& yes | sudo pacman -Scc \
|
| 180 |
-
; fi
|
| 181 |
-
|
| 182 |
-
# optional --build-arg to change branches for testing
|
| 183 |
-
ARG BRANCH=master
|
| 184 |
-
ARG REPO='https://github.com/sickcodes/Docker-OSX.git'
|
| 185 |
-
RUN git clone --recurse-submodules --depth 1 --branch "${BRANCH}" "${REPO}"
|
| 186 |
-
|
| 187 |
-
RUN touch Launch.sh \
|
| 188 |
-
&& chmod +x ./Launch.sh \
|
| 189 |
-
&& tee -a Launch.sh <<< '#!/bin/bash' \
|
| 190 |
-
&& tee -a Launch.sh <<< 'set -eux' \
|
| 191 |
-
&& tee -a Launch.sh <<< 'sudo chown $(id -u):$(id -g) /dev/kvm 2>/dev/null || true' \
|
| 192 |
-
&& tee -a Launch.sh <<< 'sudo chown -R $(id -u):$(id -g) /dev/snd 2>/dev/null || true' \
|
| 193 |
-
&& tee -a Launch.sh <<< '[[ "${RAM}" = max ]] && export RAM="$(("$(head -n1 /proc/meminfo | tr -dc "[:digit:]") / 1000000"))"' \
|
| 194 |
-
&& tee -a Launch.sh <<< '[[ "${RAM}" = half ]] && export RAM="$(("$(head -n1 /proc/meminfo | tr -dc "[:digit:]") / 2000000"))"' \
|
| 195 |
-
&& tee -a Launch.sh <<< 'sudo chown -R $(id -u):$(id -g) /dev/snd 2>/dev/null || true' \
|
| 196 |
-
&& tee -a Launch.sh <<< 'exec qemu-system-x86_64 -m ${RAM:-4}000 \' \
|
| 197 |
-
&& 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} \' \
|
| 198 |
-
&& tee -a Launch.sh <<< '-machine q35,${KVM-"accel=kvm:tcg"} \' \
|
| 199 |
-
&& tee -a Launch.sh <<< '-smp ${CPU_STRING:-${SMP:-4},cores=${CORES:-4}} \' \
|
| 200 |
-
&& tee -a Launch.sh <<< '-usb -device usb-kbd -device usb-tablet \' \
|
| 201 |
-
&& tee -a Launch.sh <<< '-device isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal\(c\)AppleComputerInc \' \
|
| 202 |
-
&& tee -a Launch.sh <<< '-drive if=pflash,format=raw,readonly=on,file=/home/arch/OSX-KVM/OVMF_CODE.fd \' \
|
| 203 |
-
&& tee -a Launch.sh <<< '-drive if=pflash,format=raw,file=/home/arch/OSX-KVM/OVMF_VARS-1024x768.fd \' \
|
| 204 |
-
&& tee -a Launch.sh <<< '-smbios type=2 \' \
|
| 205 |
-
&& tee -a Launch.sh <<< '-audiodev ${AUDIO_DRIVER:-alsa},id=hda -device ich9-intel-hda -device hda-duplex,audiodev=hda \' \
|
| 206 |
-
&& tee -a Launch.sh <<< '-device ich9-ahci,id=sata \' \
|
| 207 |
-
&& tee -a Launch.sh <<< '-drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file=${BOOTDISK:-/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2} \' \
|
| 208 |
-
&& tee -a Launch.sh <<< '-device ide-hd,bus=sata.2,drive=OpenCoreBoot \' \
|
| 209 |
-
&& tee -a Launch.sh <<< '-device ide-hd,bus=sata.3,drive=InstallMedia \' \
|
| 210 |
-
&& tee -a Launch.sh <<< '-drive id=InstallMedia,if=none,file=/home/arch/OSX-KVM/BaseSystem.img,format=${BASESYSTEM_FORMAT:-qcow2} \' \
|
| 211 |
-
&& tee -a Launch.sh <<< '-drive id=MacHDD,if=none,file=${IMAGE_PATH:-/home/arch/OSX-KVM/mac_hdd_ng.img},format=${IMAGE_FORMAT:-qcow2} \' \
|
| 212 |
-
&& tee -a Launch.sh <<< '-device ide-hd,bus=sata.4,drive=MacHDD \' \
|
| 213 |
-
&& tee -a Launch.sh <<< '-netdev user,id=net0,hostfwd=tcp::${INTERNAL_SSH_PORT:-10022}-:22,hostfwd=tcp::${SCREEN_SHARE_PORT:-5900}-:5900,${ADDITIONAL_PORTS} \' \
|
| 214 |
-
&& tee -a Launch.sh <<< '-device ${NETWORKING:-vmxnet3},netdev=net0,id=net0,mac=${MAC_ADDRESS:-52:54:00:09:49:17} \' \
|
| 215 |
-
&& tee -a Launch.sh <<< '-monitor stdio \' \
|
| 216 |
-
&& tee -a Launch.sh <<< '-boot menu=on \' \
|
| 217 |
-
&& tee -a Launch.sh <<< '-vga vmware \' \
|
| 218 |
-
&& tee -a Launch.sh <<< '${EXTRA:-}'
|
| 219 |
-
|
| 220 |
-
# docker exec containerid mv ./Launch-nopicker.sh ./Launch.sh
|
| 221 |
-
# This is now a legacy command.
|
| 222 |
-
# You can use -e BOOTDISK=/bootdisk with -v ./bootdisk.img:/bootdisk
|
| 223 |
-
|
| 224 |
-
### LEGACY CODE
|
| 225 |
-
RUN grep -v InstallMedia ./Launch.sh > ./Launch-nopicker.sh \
|
| 226 |
-
&& chmod +x ./Launch-nopicker.sh \
|
| 227 |
-
&& sed -i -e s/OpenCore\.qcow2/OpenCore\-nopicker\.qcow2/ ./Launch-nopicker.sh
|
| 228 |
-
###
|
| 229 |
-
|
| 230 |
-
USER arch
|
| 231 |
-
|
| 232 |
-
ENV USER arch
|
| 233 |
-
|
| 234 |
-
# These are hardcoded serials for non-iMessage related research
|
| 235 |
-
# Overwritten by using GENERATE_UNIQUE=true
|
| 236 |
-
# Upstream removed nopicker, so we are adding it back in, at build time
|
| 237 |
-
# Once again, this is just for the Docker build so there is a default nopicker image there
|
| 238 |
-
|
| 239 |
-
# libguestfs verbose
|
| 240 |
-
ENV LIBGUESTFS_DEBUG=1
|
| 241 |
-
ENV LIBGUESTFS_TRACE=1
|
| 242 |
-
|
| 243 |
-
ARG STOCK_DEVICE_MODEL=iMacPro1,1
|
| 244 |
-
ARG STOCK_SERIAL=C02TM2ZBHX87
|
| 245 |
-
ARG STOCK_BOARD_SERIAL=C02717306J9JG361M
|
| 246 |
-
ARG STOCK_UUID=007076A6-F2A2-4461-BBE5-BAD019F8025A
|
| 247 |
-
ARG STOCK_MAC_ADDRESS=00:0A:27:00:00:00
|
| 248 |
-
ARG STOCK_WIDTH=1920
|
| 249 |
-
ARG STOCK_HEIGHT=1080
|
| 250 |
-
ARG STOCK_MASTER_PLIST_URL=https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist
|
| 251 |
-
ARG STOCK_MASTER_PLIST_URL_NOPICKER=https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-nopicker-custom.plist
|
| 252 |
-
ARG STOCK_BOOTDISK=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2
|
| 253 |
-
ARG STOCK_BOOTDISK_NOPICKER=/home/arch/OSX-KVM/OpenCore/OpenCore-nopicker.qcow2
|
| 254 |
-
|
| 255 |
-
RUN ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \
|
| 256 |
-
--master-plist-url="${STOCK_MASTER_PLIST_URL}" \
|
| 257 |
-
--model "${STOCK_DEVICE_MODEL}" \
|
| 258 |
-
--serial "${STOCK_SERIAL}" \
|
| 259 |
-
--board-serial "${STOCK_BOARD_SERIAL}" \
|
| 260 |
-
--uuid "${STOCK_UUID}" \
|
| 261 |
-
--mac-address "${STOCK_MAC_ADDRESS}" \
|
| 262 |
-
--width "${STOCK_WIDTH}" \
|
| 263 |
-
--height "${STOCK_HEIGHT}" \
|
| 264 |
-
--output-bootdisk "${STOCK_BOOTDISK}" || exit 1 \
|
| 265 |
-
; rm -rf /var/tmp/.guestfs-*
|
| 266 |
-
|
| 267 |
-
RUN ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \
|
| 268 |
-
--master-plist-url="${STOCK_MASTER_PLIST_URL_NOPICKER}" \
|
| 269 |
-
--model "${STOCK_DEVICE_MODEL}" \
|
| 270 |
-
--serial "${STOCK_SERIAL}" \
|
| 271 |
-
--board-serial "${STOCK_BOARD_SERIAL}" \
|
| 272 |
-
--uuid "${STOCK_UUID}" \
|
| 273 |
-
--mac-address "${STOCK_MAC_ADDRESS}" \
|
| 274 |
-
--width "${STOCK_WIDTH}" \
|
| 275 |
-
--height "${STOCK_HEIGHT}" \
|
| 276 |
-
--output-bootdisk "${STOCK_BOOTDISK_NOPICKER}" || exit 1 \
|
| 277 |
-
; rm -rf /var/tmp/.guestfs-*
|
| 278 |
-
|
| 279 |
-
### symlink the old directory as upstream has renamed a directory. Symlinking purely for backwards compatability!
|
| 280 |
-
RUN ln -s /home/arch/OSX-KVM/OpenCore /home/arch/OSX-KVM/OpenCore-Catalina || true
|
| 281 |
-
####
|
| 282 |
-
|
| 283 |
-
#### SPECIAL RUNTIME ARGUMENTS BELOW
|
| 284 |
-
# env -e ADDITIONAL_PORTS with a comma
|
| 285 |
-
# for example, -e ADDITIONAL_PORTS=hostfwd=tcp::23-:23,
|
| 286 |
-
ENV ADDITIONAL_PORTS=
|
| 287 |
-
|
| 288 |
-
# since the Makefile uses raw, and raw uses the full disk amount
|
| 289 |
-
# we want to use a compressed qcow2
|
| 290 |
-
# ENV BASESYSTEM_FORMAT=raw
|
| 291 |
-
ENV BASESYSTEM_FORMAT=qcow2
|
| 292 |
-
|
| 293 |
-
# add additional QEMU boot arguments
|
| 294 |
-
ENV BOOT_ARGS=
|
| 295 |
-
|
| 296 |
-
ENV BOOTDISK=
|
| 297 |
-
|
| 298 |
-
# edit the CPU that is being emulated
|
| 299 |
-
ENV CPU=Penryn
|
| 300 |
-
ENV CPUID_FLAGS='vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check,'
|
| 301 |
-
|
| 302 |
-
ENV DISPLAY=:0.0
|
| 303 |
-
|
| 304 |
-
# Deprecated
|
| 305 |
-
ENV ENV=/env
|
| 306 |
-
|
| 307 |
-
# Boolean for generating a bootdisk with new random serials.
|
| 308 |
-
ENV GENERATE_UNIQUE=false
|
| 309 |
-
|
| 310 |
-
# Boolean for generating a bootdisk with specific serials.
|
| 311 |
-
ENV GENERATE_SPECIFIC=false
|
| 312 |
-
|
| 313 |
-
ENV IMAGE_PATH=/home/arch/OSX-KVM/mac_hdd_ng.img
|
| 314 |
-
ENV IMAGE_FORMAT=qcow2
|
| 315 |
-
|
| 316 |
-
ENV KVM='accel=kvm:tcg'
|
| 317 |
-
|
| 318 |
-
ENV MASTER_PLIST_URL="https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist"
|
| 319 |
-
|
| 320 |
-
# ENV NETWORKING=e1000-82545em
|
| 321 |
-
ENV NETWORKING=vmxnet3
|
| 322 |
-
|
| 323 |
-
# boolean for skipping the disk selection menu at in the boot process
|
| 324 |
-
ENV NOPICKER=false
|
| 325 |
-
|
| 326 |
-
# dynamic RAM options for runtime
|
| 327 |
-
ENV RAM=4
|
| 328 |
-
# ENV RAM=max
|
| 329 |
-
# ENV RAM=half
|
| 330 |
-
|
| 331 |
-
# The x and y coordinates for resolution.
|
| 332 |
-
# Must be used with either -e GENERATE_UNIQUE=true or -e GENERATE_SPECIFIC=true.
|
| 333 |
-
ENV WIDTH=1920
|
| 334 |
-
ENV HEIGHT=1080
|
| 335 |
-
|
| 336 |
-
VOLUME ["/tmp/.X11-unix"]
|
| 337 |
-
|
| 338 |
-
# check if /image is a disk image or a directory. This allows you to optionally use -v disk.img:/image
|
| 339 |
-
# NOPICKER is used to skip the disk selection screen
|
| 340 |
-
# GENERATE_UNIQUE is used to generate serial numbers on boot.
|
| 341 |
-
# /env is a file that you can generate and save using -v source.sh:/env
|
| 342 |
-
# the env file is a file that you can carry to the next container which will supply the serials numbers.
|
| 343 |
-
# GENERATE_SPECIFIC is used to either accept the env serial numbers OR you can supply using:
|
| 344 |
-
# -e DEVICE_MODEL="iMacPro1,1" \
|
| 345 |
-
# -e SERIAL="C02TW0WAHX87" \
|
| 346 |
-
# -e BOARD_SERIAL="C027251024NJG36UE" \
|
| 347 |
-
# -e UUID="5CCB366D-9118-4C61-A00A-E5BAF3BED451" \
|
| 348 |
-
# -e MAC_ADDRESS="A8:5C:2C:9A:46:2F" \
|
| 349 |
-
|
| 350 |
-
# the output will be /bootdisk.
|
| 351 |
-
# /bootdisk is a useful persistent place to store the 15Mb serial number bootdisk.
|
| 352 |
-
|
| 353 |
-
# if you don't set any of the above:
|
| 354 |
-
# the default serial numbers are already contained in ./OpenCore/OpenCore.qcow2
|
| 355 |
-
# And the default serial numbers
|
| 356 |
-
|
| 357 |
-
CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \
|
| 358 |
-
; sudo chown -R $(id -u):$(id -g) /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \
|
| 359 |
-
; [[ "${NOPICKER}" == true ]] && { \
|
| 360 |
-
sed -i '/^.*InstallMedia.*/d' Launch.sh \
|
| 361 |
-
&& export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore-nopicker.qcow2}" \
|
| 362 |
-
; } \
|
| 363 |
-
|| export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
|
| 364 |
-
; [[ "${GENERATE_UNIQUE}" == true ]] && { \
|
| 365 |
-
./Docker-OSX/osx-serial-generator/generate-unique-machine-values.sh \
|
| 366 |
-
--master-plist-url="${MASTER_PLIST_URL}" \
|
| 367 |
-
--count 1 \
|
| 368 |
-
--tsv ./serial.tsv \
|
| 369 |
-
--bootdisks \
|
| 370 |
-
--width "${WIDTH:-1920}" \
|
| 371 |
-
--height "${HEIGHT:-1080}" \
|
| 372 |
-
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
|
| 373 |
-
--output-env "${ENV:=/env}" \
|
| 374 |
-
|| exit 1 ; } \
|
| 375 |
-
; [[ "${GENERATE_SPECIFIC}" == true ]] && { \
|
| 376 |
-
source "${ENV:=/env}" 2>/dev/null \
|
| 377 |
-
; ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \
|
| 378 |
-
--master-plist-url="${MASTER_PLIST_URL}" \
|
| 379 |
-
--model "${DEVICE_MODEL}" \
|
| 380 |
-
--serial "${SERIAL}" \
|
| 381 |
-
--board-serial "${BOARD_SERIAL}" \
|
| 382 |
-
--uuid "${UUID}" \
|
| 383 |
-
--mac-address "${MAC_ADDRESS}" \
|
| 384 |
-
--width "${WIDTH:-1920}" \
|
| 385 |
-
--height "${HEIGHT:-1080}" \
|
| 386 |
-
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
|
| 387 |
-
|| exit 1 ; } \
|
| 388 |
-
; ./enable-ssh.sh && /bin/bash -c ./Launch.sh
|
| 389 |
-
|
| 390 |
-
# virt-manager mode: eta son
|
| 391 |
-
# CMD virsh define <(envsubst < Docker-OSX.xml) && virt-manager || virt-manager
|
| 392 |
-
# CMD virsh define <(envsubst < macOS-libvirt-Catalina.xml) && virt-manager || virt-manager
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|