mirror of
https://github.com/dockur/macos.git
synced 2026-03-11 08:34:24 +00:00
docs: Use relative paths (#204)
This commit is contained in:
parent
70f6feb864
commit
35922a1714
3 changed files with 59 additions and 7 deletions
|
|
@ -13,5 +13,7 @@ services:
|
|||
- 8006:8006
|
||||
- 5900:5900/tcp
|
||||
- 5900:5900/udp
|
||||
volumes:
|
||||
- ./macos:/storage
|
||||
restart: always
|
||||
stop_grace_period: 2m
|
||||
|
|
|
|||
|
|
@ -32,10 +32,6 @@ spec:
|
|||
env:
|
||||
- name: VERSION
|
||||
value: "13"
|
||||
- name: RAM_SIZE
|
||||
value: "4G"
|
||||
- name: CPU_CORES
|
||||
value: "2"
|
||||
- name: DISK_SIZE
|
||||
value: "64G"
|
||||
ports:
|
||||
|
|
|
|||
60
readme.md
60
readme.md
|
|
@ -40,6 +40,8 @@ services:
|
|||
- 8006:8006
|
||||
- 5900:5900/tcp
|
||||
- 5900:5900/udp
|
||||
volumes:
|
||||
- ./macos:/storage
|
||||
restart: always
|
||||
stop_grace_period: 2m
|
||||
```
|
||||
|
|
@ -47,7 +49,7 @@ services:
|
|||
Via Docker CLI:
|
||||
|
||||
```bash
|
||||
docker run -it --rm -p 8006:8006 --device=/dev/kvm --device=/dev/net/tun --cap-add NET_ADMIN --stop-timeout 120 dockurr/macos
|
||||
docker run -it --rm --name macos -p 8006:8006 --device=/dev/kvm --device=/dev/net/tun --cap-add NET_ADMIN -v ${PWD:-.}/macos:/storage --stop-timeout 120 dockurr/macos
|
||||
```
|
||||
|
||||
Via Kubernetes:
|
||||
|
|
@ -113,10 +115,10 @@ kubectl apply -f https://raw.githubusercontent.com/dockur/macos/refs/heads/maste
|
|||
|
||||
```yaml
|
||||
volumes:
|
||||
- /var/osx:/storage
|
||||
- ./macos:/storage
|
||||
```
|
||||
|
||||
Replace the example path `/var/osx` with the desired storage folder.
|
||||
Replace the example path `./macos` with the desired storage folder or named volume.
|
||||
|
||||
### How do I change the size of the disk?
|
||||
|
||||
|
|
@ -142,6 +144,58 @@ kubectl apply -f https://raw.githubusercontent.com/dockur/macos/refs/heads/maste
|
|||
CPU_CORES: "4"
|
||||
```
|
||||
|
||||
### How do I assign an individual IP address to the container?
|
||||
|
||||
By default, the container uses bridge networking, which shares the IP address with the host.
|
||||
|
||||
If you want to assign an individual IP address to the container, you can create a macvlan network as follows:
|
||||
|
||||
```bash
|
||||
docker network create -d macvlan \
|
||||
--subnet=192.168.0.0/24 \
|
||||
--gateway=192.168.0.1 \
|
||||
--ip-range=192.168.0.100/28 \
|
||||
-o parent=eth0 vlan
|
||||
```
|
||||
|
||||
Be sure to modify these values to match your local subnet.
|
||||
|
||||
Once you have created the network, change your compose file to look as follows:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
macos:
|
||||
container_name: macos
|
||||
..<snip>..
|
||||
networks:
|
||||
vlan:
|
||||
ipv4_address: 192.168.0.100
|
||||
|
||||
networks:
|
||||
vlan:
|
||||
external: true
|
||||
```
|
||||
|
||||
An added benefit of this approach is that you won't have to perform any port mapping anymore, since all ports will be exposed by default.
|
||||
|
||||
> [!IMPORTANT]
|
||||
> This IP address won't be accessible from the Docker host due to the design of macvlan, which doesn't permit communication between the two. If this is a concern, you need to create a [second macvlan](https://blog.oddbit.com/post/2018-03-12-using-docker-macvlan-networks/#host-access) as a workaround.
|
||||
|
||||
### How can macOS acquire an IP address from my router?
|
||||
|
||||
After configuring the container for [macvlan](#how-do-i-assign-an-individual-ip-address-to-the-container), it is possible for macOS to become part of your home network by requesting an IP from your router, just like a real PC.
|
||||
|
||||
To enable this mode, in which the container and macOS will have separate IP addresses, add the following lines to your compose file:
|
||||
|
||||
```yaml
|
||||
environment:
|
||||
DHCP: "Y"
|
||||
devices:
|
||||
- /dev/vhost-net
|
||||
device_cgroup_rules:
|
||||
- 'c *:* rwm'
|
||||
```
|
||||
|
||||
### How do I pass-through a USB device?
|
||||
|
||||
To pass-through a USB device, first lookup its vendor and product id via the `lsusb` command, then add them to your compose file like this:
|
||||
|
|
|
|||
Loading…
Reference in a new issue