aboutsummaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
authorsickcodes <[email protected]>2020-09-24 12:11:12 +0000
committerGitHub <[email protected]>2020-09-24 12:11:12 +0000
commit07f488a470bf4f04f03b369d87e1c05b3706397d (patch)
treea6d2acc2290f03928d3ebc24fac24498e5186bff /Dockerfile
parentREADME update for current feature set (diff)
parentimprove handling of BaseSystem.dmg to reduce image by 2.5GB (from 6GB) (diff)
downloaddocker-osx-07f488a470bf4f04f03b369d87e1c05b3706397d.tar.xz
docker-osx-07f488a470bf4f04f03b369d87e1c05b3706397d.zip
Merge pull request #82 from jimdigriz/tweaks
misc improvements to build, runtime and documentation
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile70
1 files changed, 31 insertions, 39 deletions
diff --git a/Dockerfile b/Dockerfile
index b8111b2..a62609c 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -72,6 +72,7 @@ RUN tee -a /etc/pacman.conf <<< '[community-testing]' \
RUN pacman -Syu --noconfirm \
&& pacman -S sudo git make automake gcc python go autoconf cmake pkgconf alsa-utils fakeroot --noconfirm \
+ && yes | pacman -Scc \
&& useradd arch -p arch \
&& tee -a /etc/sudoers <<< 'arch ALL=(ALL) NOPASSWD: ALL' \
&& mkdir /home/arch \
@@ -98,27 +99,11 @@ RUN tee -a sshd_config <<< 'AllowTcpForwarding yes' \
&& tee -a sshd_config <<< 'HostKey /etc/ssh/ssh_host_ed25519_key'
USER arch
-WORKDIR /home/arch
-RUN git clone https://github.com/corpnewt/gibMacOS.git
-WORKDIR /home/arch/gibMacOS
-RUN perl -p -i -e 's/print("Succeeded:")/exit()/' ./gibMacOS.command
-
-# this command takes a while!
-RUN python gibMacOS.command -v "${VERSION}" -d || echo Done
-
-RUN sudo pacman -Syu qemu libvirt dnsmasq virt-manager bridge-utils flex bison ebtables edk2-ovmf netctl libvirt-dbus libguestfs --noconfirm
-# RUN sudo systemctl enable libvirtd.service
-# RUN sudo systemctl enable virtlogd.service
# download OSX-KVM
WORKDIR /home/arch
RUN git clone https://github.com/kholia/OSX-KVM.git
-# create disk
-WORKDIR /home/arch/OSX-KVM
-RUN qemu-img convert ${HOME}/gibMacOS/macOS\ Downloads/publicrelease/*/BaseSystem.dmg -O raw ${HOME}/OSX-KVM/BaseSystem.img \
- && qemu-img create -f qcow2 mac_hdd_ng.img "${SIZE}"
-
# enable ssh
# docker exec .... ./enable-ssh.sh
USER arch
@@ -137,49 +122,56 @@ RUN touch enable-ssh.sh \
# default env vars, RUNTIME ONLY, not for editing in build time.
+RUN sudo pacman -Syu qemu libvirt dnsmasq virt-manager bridge-utils flex bison ebtables edk2-ovmf netctl libvirt-dbus libguestfs --noconfirm && yes | sudo pacman -Scc
+# RUN sudo systemctl enable libvirtd.service
+# RUN sudo systemctl enable virtlogd.service
+
+WORKDIR /home/arch
+RUN git clone https://github.com/corpnewt/gibMacOS.git
+WORKDIR /home/arch/gibMacOS
+
+# this command takes a while!
+RUN perl -p -i -e 's/print("Succeeded:")/exit()/' ./gibMacOS.command \
+ && { python gibMacOS.command -v "${VERSION}" -d || echo Done; } \
+ && qemu-img convert ${HOME}/gibMacOS/macOS\ Downloads/publicrelease/*/BaseSystem.dmg -O qcow2 -p -c ${HOME}/OSX-KVM/BaseSystem.img \
+ && qemu-img create -f qcow2 ${HOME}/OSX-KVM/mac_hdd_ng.img "${SIZE}" \
+ && rm ${HOME}/gibMacOS/macOS\ Downloads/publicrelease/*/BaseSystem.dmg
+
# > Launch.sh
# > Docker-OSX.xml
+WORKDIR /home/arch
RUN touch Launch.sh \
&& chmod +x ./Launch.sh \
- && tee -a Launch.sh <<< 'qemu-system-x86_64 -enable-kvm -m ${RAM}000 \' \
- && tee -a Launch.sh <<< '-cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+pcid,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check \' \
- && tee -a Launch.sh <<< '-machine q35 \' \
- && tee -a Launch.sh <<< '-smp ${SMP},cores=${CORES} \' \
+ && tee -a Launch.sh <<< '#!/bin/sh' \
+ && tee -a Launch.sh <<< 'set -eu' \
+ && 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 <<< 'exec qemu-system-x86_64 -m ${RAM:-8}000 \' \
+ && tee -a Launch.sh <<< '-cpu Penryn,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+pcid,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check \' \
+ && tee -a Launch.sh <<< '-machine q35,accel=kvm:tcg \' \
+ && tee -a Launch.sh <<< '-smp ${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,file=/home/arch/OSX-KVM/OVMF_CODE.fd \' \
- && tee -a Launch.sh <<< '-drive if=pflash,format=raw,file=./OVMF_VARS-1024x768.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 <<< '-device ich9-intel-hda -device hda-duplex \' \
+ && 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=/home/arch/OSX-KVM/OpenCore-Catalina/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=BaseSystem.img,format=raw \' \
+ && tee -a Launch.sh <<< '-drive id=InstallMedia,if=none,file=/home/arch/OSX-KVM/BaseSystem.img,format=qcow2 \' \
&& tee -a Launch.sh <<< '-drive id=MacHDD,if=none,file=/home/arch/OSX-KVM/mac_hdd_ng.img,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}-:22,hostfwd=tcp::${SCREEN_SHARE_PORT}-:5900, -device e1000-82545em,netdev=net0,id=net0,mac=52:54:00:09:49:17 \' \
+ && tee -a Launch.sh <<< '-netdev user,id=net0,hostfwd=tcp::${INTERNAL_SSH_PORT:-10022}-:22,hostfwd=tcp::${SCREEN_SHARE_PORT:-5900}-:5900, -device e1000-82545em,netdev=net0,id=net0,mac=52:54:00:09:49:17 \' \
&& tee -a Launch.sh <<< '-monitor stdio \' \
&& tee -a Launch.sh <<< '-vga vmware \' \
- && tee -a Launch.sh <<< '${EXTRA}'
+ && tee -a Launch.sh <<< '${EXTRA:-}'
ENV USER arch
-ENV RAM=8
-ENV SMP=4
-ENV CORES=4
-ENV EXTRA=
-ENV INTERNAL_SSH_PORT=10022
-ENV SCREEN_SHARE_PORT=5900
-
-# if you're in the shell, export these variables to use then in envsubst
-# export RAM=5
-# export SMP=4
-# export CORES=4
-# export EXTRA=
-# export INTERNAL_SSH_PORT=10022
-# export SCREEN_SHARE_PORT=5900
+ENV DISPLAY=:0.0
USER arch
VOLUME ["/tmp/.X11-unix"]