diff --git a/CHANGELOG.md b/CHANGELOG.md index 2297426..d3e361f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ |Version|Date|Notes| |---|---|---| -|2.7|2021-01-05|Add rankmirrors.| +|2.7|2021-01-05|Add rankmirrors. Remove gibMacOS. Replace iptables with iptables-nft. Remove libguestfs.| | |2020-12-17|Remove unnecessary WORKDIR commands.| | |2020-12-16|Reduce image size by cloning OSX-KVM to only 1 depth level. Simplify mkdir && chown to mkdir -m| | |2020-10-06|Add the ability to skip the boot screen with ./Launch-nopicker.sh| diff --git a/CREDITS.md b/CREDITS.md index 37e8bda..8265301 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -41,3 +41,6 @@ These credits refer to the contributors to this repository: [@PeterDaveHello](https://github.com/PeterDaveHello) - Reduce Dockerfile instructions and Docker image layers #112 [@weskerfoot](https://github.com/weskerfoot) Docs updates: usb passthrough, headless mode, disk space reduction guide #113 + +[@PeterDaveHello](https://github.com/PeterDaveHello) - Improve Dockerfile #121 + diff --git a/Dockerfile b/Dockerfile index 6e0eaaa..82650ad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ # Repo: https://github.com/sickcodes/Docker-OSX/ # Title: Mac on Docker (Docker-OSX) # Author: Sick.Codes https://sick.codes/ -# Version: 2.6 +# Version: 2.7 # License: GPLv3+ # # All credits for OSX-KVM and the rest at @Kholia's repo: https://github.com/kholia/osx-kvm @@ -133,20 +133,20 @@ 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 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 iptables-nft edk2-ovmf netctl libvirt-dbus --overwrite --noconfirm \ + ; yes | sudo pacman -Scc + # RUN sudo systemctl enable libvirtd.service # RUN sudo systemctl enable virtlogd.service -RUN git clone --depth 1 https://github.com/corpnewt/gibMacOS.git /home/arch/OSX-KVM/gibMacOS - -WORKDIR /home/arch/OSX-KVM/gibMacOS +WORKDIR /home/arch/OSX-KVM -# 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/arch/OSX-KVM/gibMacOS/macOS\ Downloads/publicrelease/*/BaseSystem.dmg -O qcow2 -p -c /home/arch/OSX-KVM/BaseSystem.img \ - && qemu-img create -f qcow2 /home/arch/OSX-KVM/mac_hdd_ng.img "${SIZE}" \ - && rm /home/arch/OSX-KVM/gibMacOS/macOS\ Downloads/publicrelease/*/BaseSystem.dmg +RUN python fetch-macOS.py --version "${VERSION}" \ + && 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 # > Launch.sh # > Docker-OSX.xml diff --git a/README.md b/README.md index c88ead6..fac1e07 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,35 @@ # Docker-OSX ## [Follow @sickcodes on Twitter](https://twitter.com/sickcodes) -### V2.6 -# Features In Docker-OSX v2.6 +![Running mac osx in a docker container](/running-mac-inside-docker-qemu.png?raw=true "OSX KVM DOCKER") + +Run Mac in a Docker container! Run near native OSX-KVM in Docker! X11 Forwarding! + +Author: Sick.Codes https://sick.codes/ & https://twitter.com/sickcodes + +PR & Contributor Credits: https://github.com/sickcodes/Docker-OSX/blob/master/CREDITS.md + +Docker Hub: https://hub.docker.com/r/sickcodes/docker-osx + +# Quick Start Docker-OSX +```bash + +docker run \ + --device /dev/kvm \ + -p 50922:10022 \ + -v /tmp/.X11-unix:/tmp/.X11-unix \ + -e "DISPLAY=${DISPLAY:-:0.0}" \ + sickcodes/docker-osx:latest + +# Wait 2-3 minutes until you see the logo. + +``` + +# Features Coming in v3.0 +- Fully automated installation. +- Ready-to-go instances. + +# Features In Docker-OSX v2.7 - CI/CD weaponization thru vnc and xdotool - OSX-KVM - X11 Forwarding @@ -12,22 +39,14 @@ - Create an ARMY using `docker commit` - XFVB HEADLESS (use vnc) -### Pull Requests Welcome! - -![Running mac osx in a docker container](/running-mac-inside-docker-qemu.png?raw=true "OSX KVM DOCKER") - -Run Mac in a Docker container! Run near native OSX-KVM in Docker! X11 Forwarding! - -Author: Sick.Codes https://sick.codes/ & https://twitter.com/sickcodes +### All Pull Requests Welcome! -PR & Contributor Credits: https://github.com/sickcodes/Docker-OSX/blob/master/CREDITS.md +Docker-OSX is a GPLv3+ Dockerfile and we need contributors just like you :). Upstream: https://github.com/kholia/OSX-KVM && the great guy [@kholia](https://twitter.com/kholia) Upstream Credits (OSX-KVM project) among many others: https://github.com/kholia/OSX-KVM/blob/master/CREDITS.md -Docker Hub: https://hub.docker.com/r/sickcodes/docker-osx - ### Other cool Docker-QEMU based projects: [Run iOS in a Docker with Docker-eyeOS](https://github.com/sickcodes/Docker-eyeOS) - [https://github.com/sickcodes/Docker-eyeOS](https://github.com/sickcodes/Docker-eyeOS) @@ -432,13 +451,19 @@ Note: `-disable-ticketing` will allow unauthenticated access to the VM. See the Then simply do `remote-viewer spice://localhost:3001` and add `--spice-debug` for debugging. +# Custom Build or Local Development + +If you are building Docker-OSX locally, you will want to use Arch Linux mirrors. +Mirror locations can be found here (use 2 letter country codes): https://archlinux.org/mirrorlist/all/ -# Custom Build ```bash docker build -t docker-osx:latest \ - --build-arg VERSION=10.14.6 \ - --build-arg SIZE=200G + --build-arg RANKMIRRORS=yes \ + --build-arg MIRROR_COUNTRY=US \ + --build-arg MIRROR_COUNT=10 \ + --build-arg VERSION=10.15.6 \ + --build-arg SIZE=200G . ``` # Custom QEMU Arguments (passthrough devices) diff --git a/vnc-version/Dockerfile b/vnc-version/Dockerfile index 0b3fe0f..971dfb1 100644 --- a/vnc-version/Dockerfile +++ b/vnc-version/Dockerfile @@ -7,7 +7,7 @@ # # Title: Mac on Docker (Docker-OSX) [VNC EDITION] # Author: Sick.Codes https://sick.codes/ -# Version: 2.6 +# Version: 2.7 # License: GPLv3+ # # All credits for OSX-KVM and the rest at Kholia's repo: https://github.com/kholia/osx-kvm @@ -72,14 +72,21 @@ MAINTAINER 'https://twitter.com/sickcodes' USER root -RUN tee -a /etc/pacman.d/mirrorlist <<< 'Server = http://mirrors.evowise.com/archlinux/$repo/os/$arch' \ - && tee -a /etc/pacman.d/mirrorlist <<< 'Server = http://mirror.rackspace.com/archlinux/$repo/os/$arch' \ - && tee -a /etc/pacman.d/mirrorlist <<< 'Server = https://mirror.rackspace.com/archlinux/$repo/os/$arch' +ARG RANKMIRRORS=no +ARG MIRROR_COUNTRY=US +ARG MIRROR_COUNT=10 -# ARG MIRROR_COUNTRY=US -# RUN curl -s "https://www.archlinux.org/mirrorlist/?country=${MIRROR_COUNTRY}&protocol=https&use_mirror_status=on" | \ -# sed -e 's/^#Server/Server/' -e '/^#/d' | \ -# rankmirrors -n 5 - > /etc/pacman.d/mirrorlist +# Arch Linux server mirrors for faster builds +RUN if [[ "${RANKMIRRORS}" = yes ]]; then { pacman -Sy wget --noconfirm || pacman -Syu wget --noconfirm ; } \ + ; 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" \ + | sed -e 's/^#Server/Server/' -e '/^#/d' \ + | head -n "$((${MIRROR_COUNT:-10}+1))" \ + | bash ./rankmirrors --verbose --max-time 5 - > /etc/pacman.d/mirrorlist \ + && tee -a /etc/pacman.d/mirrorlist <<< 'Server = http://mirrors.evowise.com/archlinux/$repo/os/$arch' \ + && tee -a /etc/pacman.d/mirrorlist <<< 'Server = http://mirror.rackspace.com/archlinux/$repo/os/$arch' \ + && tee -a /etc/pacman.d/mirrorlist <<< 'Server = https://mirror.rackspace.com/archlinux/$repo/os/$arch' \ + && cat /etc/pacman.d/mirrorlist; fi USER arch