2024-06-02 13:23:39 +00:00
< h1 align = "center" > OSX< br / >
2024-01-14 16:02:53 +00:00
< div align = "center" >
2024-06-04 09:57:27 +00:00
< a href = "https://github.com/dockur/macos/" > < img src = "https://github.com/dockur/macos/raw/master/.github/logo.png" title = "Logo" style = "max-width:100%;" width = "128" / > < / a >
2024-01-14 16:02:53 +00:00
< / div >
< div align = "center" >
2024-06-02 20:18:34 +00:00
[![Build]][build_url]
[![Version]][tag_url]
[![Size]][tag_url]
[![Pulls]][hub_url]
2024-01-14 16:02:53 +00:00
< / div > < / h1 >
2024-06-04 09:38:05 +00:00
OSX (macOS) inside a Docker container.
2024-01-14 16:02:53 +00:00
## Features
- KVM acceleration
2024-06-02 20:11:04 +00:00
- Image downloader
2024-01-15 03:11:08 +00:00
- Web-based viewer
2024-01-14 16:02:53 +00:00
## Usage
2024-04-06 23:59:20 +00:00
Via Docker Compose:
2024-01-14 16:02:53 +00:00
```yaml
services:
2024-06-04 09:57:27 +00:00
macos:
image: dockurr/macos
container_name: macos
2024-03-26 01:28:13 +00:00
environment:
2024-06-05 12:16:56 +00:00
VERSION: "sonoma"
2024-01-14 16:02:53 +00:00
devices:
- /dev/kvm
cap_add:
- NET_ADMIN
ports:
- 8006:8006
2024-06-02 13:23:39 +00:00
- 5900:5900/tcp
- 5900:5900/udp
2024-01-14 16:02:53 +00:00
stop_grace_period: 2m
```
2024-04-06 23:59:20 +00:00
Via Docker CLI:
2024-01-14 16:02:53 +00:00
```bash
2024-06-04 09:57:27 +00:00
docker run -it --rm -p 8006:8006 --device=/dev/kvm --cap-add NET_ADMIN --stop-timeout 120 dockurr/macos
2024-01-14 16:02:53 +00:00
```
2024-05-16 00:20:23 +00:00
Via Kubernetes:
```shell
kubectl apply -f kubernetes.yml
```
2024-01-14 16:02:53 +00:00
## FAQ
2024-01-27 18:49:37 +00:00
* ### How do I use it?
2024-01-15 03:01:54 +00:00
2024-01-27 18:49:37 +00:00
Very simple! These are the steps:
- Start the container and connect to [port 8006 ](http://localhost:8006 ) using your web browser.
2024-01-15 03:04:39 +00:00
2024-06-04 09:38:05 +00:00
- Select `macOS Base System` using your keyboard to begin the installation.
2024-01-14 16:02:53 +00:00
2024-06-05 03:19:46 +00:00
- Select `Disk Utility` and then select the largest `Apple Inc. VirtIO Block Media` disk.
2024-01-14 16:02:53 +00:00
2024-06-03 07:55:44 +00:00
- Click `Erase` to format the disk, and give it any recognizable name you like.
2024-01-14 16:02:53 +00:00
2024-06-05 03:19:46 +00:00
- Close the window and proceed the installation by clicking `Reinstall macOS` .
2024-01-27 18:49:37 +00:00
2024-06-03 07:51:37 +00:00
- When prompted where to install the OS, select the disk you just created.
2024-02-09 23:11:46 +00:00
2024-06-05 03:19:46 +00:00
- There will be several reboots during the installation, keep selecting `macOS Installer` until it offers the option to select the disk you created.
- Keep selecting your own disk each reboot from now on.
- You will be guided through the installation. Select your region, account name, and other options.
2024-06-04 09:38:05 +00:00
- Once you see the desktop, your macOS installation is ready for use.
2024-02-02 12:01:24 +00:00
2024-06-02 13:23:39 +00:00
Enjoy your brand new machine, and don't forget to star this repo!
2024-01-31 03:38:22 +00:00
2024-06-04 09:38:05 +00:00
* ### How do I select the macOS version?
2024-01-31 03:38:22 +00:00
2024-06-05 12:16:56 +00:00
By default, macOS Sonoma will be installed. But you can add the `VERSION` environment variable to your compose file, in order to specify an alternative macOS version to be downloaded:
2024-01-31 03:38:22 +00:00
```yaml
environment:
2024-06-05 12:16:56 +00:00
VERSION: "sonoma"
2024-01-31 03:38:22 +00:00
```
2024-06-02 13:23:39 +00:00
Select from the values below:
2024-05-09 09:19:34 +00:00
2024-06-05 12:16:56 +00:00
| **Value** | **Version** |
2024-06-05 03:38:58 +00:00
|----|-----|
2024-06-05 12:16:56 +00:00
| `sonoma` | macOS Sonoma |
| `ventura` | macOS Ventura |
| `monterey` | macOS Monterey |
| `big-sur` | macOS Big Sur |
2024-06-02 23:57:27 +00:00
2024-06-02 20:56:14 +00:00
* ### How do I change the storage location?
To change the storage location, include the following bind mount in your compose file:
```yaml
volumes:
2024-06-04 09:57:27 +00:00
- /var/macos:/storage
2024-06-02 20:56:14 +00:00
```
2024-06-04 09:57:27 +00:00
Replace the example path `/var/macos` with the desired storage folder.
2024-06-02 20:56:14 +00:00
* ### How do I change the size of the disk?
2024-06-03 18:58:35 +00:00
To expand the default size of 32 GB, add the `DISK_SIZE` setting to your compose file and set it to your preferred capacity:
2024-06-02 20:56:14 +00:00
```yaml
environment:
DISK_SIZE: "256G"
```
This can also be used to resize the existing disk to a larger capacity without any data loss.
* ### How do I change the amount of CPU or RAM?
2024-06-03 20:57:53 +00:00
By default, the container will be allowed to use a maximum of 2 CPU cores and 3 GB of RAM.
2024-06-02 20:56:14 +00:00
If you want to adjust this, you can specify the desired amount using the following environment variables:
```yaml
environment:
RAM_SIZE: "8G"
CPU_CORES: "4"
```
2024-06-02 23:57:27 +00:00
2024-06-04 09:38:05 +00:00
Please note that macOS requires the CPU core count to always be a power of 2.
2024-06-03 07:55:44 +00:00
2024-06-03 07:51:37 +00:00
* ### How do I verify if my system supports KVM?
2024-06-02 23:57:27 +00:00
To verify if your system supports KVM, run the following commands:
```bash
sudo apt install cpu-checker
sudo kvm-ok
```
If you receive an error from `kvm-ok` indicating that KVM acceleration can't be used, check the virtualization settings in the BIOS.
2024-06-02 20:56:14 +00:00
* ### Is this project legal?
Yes, this project contains only open-source code and does not distribute any copyrighted material. So under all applicable laws, this project will be considered legal.
2024-01-17 15:32:20 +00:00
2024-06-02 13:23:39 +00:00
## Acknowledgements
2024-01-31 12:40:50 +00:00
2024-06-04 09:38:05 +00:00
Special thanks to [seitenca ](https://github.com/seitenca ) and [OSX-KVM ](https://github.com/kholia/OSX-KVM ), this project would not exist without their invaluable work.
2024-01-14 16:33:46 +00:00
2024-06-02 20:18:34 +00:00
## Stars
2024-06-04 09:57:27 +00:00
[](https://starchart.cc/dockur/macos)
2024-06-02 20:18:34 +00:00
2024-01-14 16:33:46 +00:00
## Disclaimer
2024-06-02 20:11:04 +00:00
The product names, logos, brands, and other trademarks referred to within this project are the property of their respective trademark holders. This project is not affiliated, sponsored, or endorsed by Apple Inc.
2024-06-02 20:18:34 +00:00
2024-06-04 09:57:27 +00:00
[build_url]: https://github.com/dockur/macos/
[hub_url]: https://hub.docker.com/r/dockurr/macos/
[tag_url]: https://hub.docker.com/r/dockurr/macos/tags
2024-06-02 20:18:34 +00:00
2024-06-04 09:57:27 +00:00
[Build]: https://github.com/dockur/macos/actions/workflows/build.yml/badge.svg
[Size]: https://img.shields.io/docker/image-size/dockurr/macos/latest?color=066da5& label=size
[Pulls]: https://img.shields.io/docker/pulls/dockurr/macos.svg?style=flat& label=pulls& logo=docker
[Version]: https://img.shields.io/docker/v/dockurr/macos/latest?arch=amd64& sort=semver& color=066da5