Merge pull request #374 from sickcodes/mojave-high-sierra

Add High-Sierra, and version granularity
This commit is contained in:
sickcodes 2021-11-14 18:51:40 +00:00 committed by GitHub
commit 5fdf587a29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 221 additions and 131 deletions

View File

@ -58,7 +58,6 @@ 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
@ -139,32 +138,16 @@ 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
&& 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
ARG FETCH_MAC_OS_RAW=https://raw.githubusercontent.com/acidanthera/OpenCorePkg/master/Utilities/macrecovery/macrecovery.py
# 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
@ -202,7 +185,7 @@ RUN touch Launch.sh \
&& tee -a Launch.sh <<< '-drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file=${BOOTDISK:-/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2} \' \ && tee -a Launch.sh <<< '-drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file=${BOOTDISK:-/home/arch/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=raw \' \
&& 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} \' \

115
README.md
View File

@ -9,13 +9,13 @@ 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.
<p align="center"> <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/mx8pPw39Yg"><a href="https://discord.gg/mx8pPw39Yg" target="_blank"><img src="https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/discord-logo.svg"></a></a> <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> </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)
@ -50,7 +50,7 @@ Video setup tutorial is also available here: https://www.youtube.com/watch?v=wLe
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://img.shields.io/docker/image-size/sickcodes/docker-osx/latest?label=sickcodes%2Fdocker-osx%3Alatest](https://img.shields.io/docker/image-size/sickcodes/docker-osx/latest?label=sickcodes%2Fdocker-osx%3Alatest)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated) ### Catalina [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/latest?label=sickcodes%2Fdocker-osx%3Alatest](https://img.shields.io/docker/image-size/sickcodes/docker-osx/latest?label=sickcodes%2Fdocker-osx%3Alatest)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
@ -74,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 --build-arg VERSION='Big Sur' . # docker build -t docker-osx --build-arg SHORTNAME=big-sur .
``` ```
### Monterey [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/monterey?label=sickcodes%2Fdocker-osx%3Amonterey](https://img.shields.io/docker/image-size/sickcodes/docker-osx/monterey?label=sickcodes%2Fdocker-osx%3Amonterey)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated) ### Monterey [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/monterey?label=sickcodes%2Fdocker-osx%3Amonterey](https://img.shields.io/docker/image-size/sickcodes/docker-osx/monterey?label=sickcodes%2Fdocker-osx%3Amonterey)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
@ -90,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://img.shields.io/docker/image-size/sickcodes/docker-osx/auto?label=sickcodes%2Fdocker-osx%3Aauto](https://img.shields.io/docker/image-size/sickcodes/docker-osx/auto?label=sickcodes%2Fdocker-osx%3Aauto)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated) #### Run Catalina Pre-Installed [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/auto?label=sickcodes%2Fdocker-osx%3Aauto](https://img.shields.io/docker/image-size/sickcodes/docker-osx/auto?label=sickcodes%2Fdocker-osx%3Aauto)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
@ -112,6 +112,38 @@ docker run -it \
# passsword is alpine # passsword is alpine
``` ```
### Older Systems
### High Sierra [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/high-sierra?label=sickcodes%2Fdocker-osx%3Ahigh-sierra](https://img.shields.io/docker/image-size/sickcodes/docker-osx/high-sierra?label=sickcodes%2Fdocker-osx%3Ahigh-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://img.shields.io/docker/image-size/sickcodes/docker-osx/mojave?label=sickcodes%2Fdocker-osx%3Amojave](https://img.shields.io/docker/image-size/sickcodes/docker-osx/mojave?label=sickcodes%2Fdocker-osx%3Amojave)](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://img.shields.io/docker/image-size/sickcodes/docker-osx/naked?label=sickcodes%2Fdocker-osx%3Anaked](https://img.shields.io/docker/image-size/sickcodes/docker-osx/naked?label=sickcodes%2Fdocker-osx%3Anaked)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated) [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/naked?label=sickcodes%2Fdocker-osx%3Anaked](https://img.shields.io/docker/image-size/sickcodes/docker-osx/naked?label=sickcodes%2Fdocker-osx%3Anaked)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
@ -255,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://img.shields.io/docker/image-size/sickcodes/docker-osx/high-sierra?label=sickcodes%2Fdocker-osx%3Ahigh-sierra](https://img.shields.io/docker/image-size/sickcodes/docker-osx/high-sierra?label=sickcodes%2Fdocker-osx%3Ahigh-sierra)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
Mojave:
[![https://img.shields.io/docker/image-size/sickcodes/docker-osx/mojave?label=sickcodes%2Fdocker-osx%3Amojave](https://img.shields.io/docker/image-size/sickcodes/docker-osx/mojave?label=sickcodes%2Fdocker-osx%3Amojave)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
Catalina:
[![https://img.shields.io/docker/image-size/sickcodes/docker-osx/latest?label=sickcodes%2Fdocker-osx%3Alatest](https://img.shields.io/docker/image-size/sickcodes/docker-osx/latest?label=sickcodes%2Fdocker-osx%3Alatest)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated) [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/latest?label=sickcodes%2Fdocker-osx%3Alatest](https://img.shields.io/docker/image-size/sickcodes/docker-osx/latest?label=sickcodes%2Fdocker-osx%3Alatest)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
Big-Sur make your own image: Big-Sur:
[![https://img.shields.io/docker/image-size/sickcodes/docker-osx/big-sur?label=sickcodes%2Fdocker-osx%3Abig-sur](https://img.shields.io/docker/image-size/sickcodes/docker-osx/big-sur?label=sickcodes%2Fdocker-osx%3Abig-sur)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated) [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/big-sur?label=sickcodes%2Fdocker-osx%3Abig-sur](https://img.shields.io/docker/image-size/sickcodes/docker-osx/big-sur?label=sickcodes%2Fdocker-osx%3Abig-sur)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
@ -287,25 +332,26 @@ Monterey make your own image:
[![https://img.shields.io/docker/image-size/sickcodes/docker-osx/monterey?label=sickcodes%2Fdocker-osx%3Amonterey](https://img.shields.io/docker/image-size/sickcodes/docker-osx/monterey?label=sickcodes%2Fdocker-osx%3Amonterey)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated) [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/monterey?label=sickcodes%2Fdocker-osx%3Amonterey](https://img.shields.io/docker/image-size/sickcodes/docker-osx/monterey?label=sickcodes%2Fdocker-osx%3Amonterey)](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://img.shields.io/docker/image-size/sickcodes/docker-osx/auto?label=sickcodes%2Fdocker-osx%3Aauto](https://img.shields.io/docker/image-size/sickcodes/docker-osx/auto?label=sickcodes%2Fdocker-osx%3Aauto)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated) [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/auto?label=sickcodes%2Fdocker-osx%3Aauto](https://img.shields.io/docker/image-size/sickcodes/docker-osx/auto?label=sickcodes%2Fdocker-osx%3Aauto)](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://img.shields.io/docker/image-size/sickcodes/docker-osx/naked?label=sickcodes%2Fdocker-osx%3Anaked](https://img.shields.io/docker/image-size/sickcodes/docker-osx/naked?label=sickcodes%2Fdocker-osx%3Anaked)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated) [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/naked?label=sickcodes%2Fdocker-osx%3Anaked](https://img.shields.io/docker/image-size/sickcodes/docker-osx/naked?label=sickcodes%2Fdocker-osx%3Anaked)](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://img.shields.io/docker/image-size/sickcodes/docker-osx/naked-auto?label=sickcodes%2Fdocker-osx%3Anaked-auto](https://img.shields.io/docker/image-size/sickcodes/docker-osx/naked-auto?label=sickcodes%2Fdocker-osx%3Anaked-auto)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated) [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/naked-auto?label=sickcodes%2Fdocker-osx%3Anaked-auto](https://img.shields.io/docker/image-size/sickcodes/docker-osx/naked-auto?label=sickcodes%2Fdocker-osx%3Anaked-auto)](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
@ -313,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
@ -399,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.
@ -428,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`
@ -439,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
@ -489,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:
@ -509,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
@ -883,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 .
``` ```

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
View 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 KiB

BIN
tests/mojave_master.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 KiB

BIN
tests/monterey_master.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

View File

@ -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,23 +200,10 @@ 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 \ --squash \
@ -223,7 +214,6 @@ 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 \ --squash \
@ -234,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 \
@ -263,14 +233,26 @@ 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 () {
@ -288,42 +270,47 @@ EOF
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
; 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