mirror of
https://github.com/dockur/macos.git
synced 2026-03-11 08:34:24 +00:00
Compare commits
No commits in common. "master" and "v2.25" have entirely different histories.
15 changed files with 71 additions and 146 deletions
|
|
@ -3,17 +3,19 @@
|
|||
"service": "macos",
|
||||
"containerEnv": {
|
||||
"VERSION": "15"
|
||||
},
|
||||
"forwardPorts": [8006],
|
||||
},
|
||||
"forwardPorts": [8006],
|
||||
"portsAttributes": {
|
||||
"8006": {
|
||||
"label": "Web",
|
||||
"onAutoForward": "notify"
|
||||
"onAutoForward": "openBrowser"
|
||||
}
|
||||
},
|
||||
"otherPortsAttributes": {
|
||||
"onAutoForward": "ignore"
|
||||
"onAutoForward": "silent"
|
||||
},
|
||||
"dockerComposeFile": "../codespaces.yml",
|
||||
"initializeCommand": "docker system prune --all --force"
|
||||
"hostRequirements": {
|
||||
"storage": "64gb"
|
||||
},
|
||||
"dockerComposeFile": "../codespaces.yml"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,17 +3,19 @@
|
|||
"service": "macos",
|
||||
"containerEnv": {
|
||||
"VERSION": "13"
|
||||
},
|
||||
"forwardPorts": [8006],
|
||||
},
|
||||
"forwardPorts": [8006],
|
||||
"portsAttributes": {
|
||||
"8006": {
|
||||
"label": "Web",
|
||||
"onAutoForward": "notify"
|
||||
"onAutoForward": "openBrowser"
|
||||
}
|
||||
},
|
||||
"otherPortsAttributes": {
|
||||
"onAutoForward": "ignore"
|
||||
"onAutoForward": "silent"
|
||||
},
|
||||
"dockerComposeFile": "../codespaces.yml",
|
||||
"initializeCommand": "docker system prune --all --force"
|
||||
"hostRequirements": {
|
||||
"storage": "64gb"
|
||||
},
|
||||
"dockerComposeFile": "../codespaces.yml"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,17 +3,19 @@
|
|||
"service": "macos",
|
||||
"containerEnv": {
|
||||
"VERSION": "12"
|
||||
},
|
||||
"forwardPorts": [8006],
|
||||
},
|
||||
"forwardPorts": [8006],
|
||||
"portsAttributes": {
|
||||
"8006": {
|
||||
"label": "Web",
|
||||
"onAutoForward": "notify"
|
||||
"onAutoForward": "openBrowser"
|
||||
}
|
||||
},
|
||||
"otherPortsAttributes": {
|
||||
"onAutoForward": "ignore"
|
||||
"onAutoForward": "silent"
|
||||
},
|
||||
"dockerComposeFile": "../codespaces.yml",
|
||||
"initializeCommand": "docker system prune --all --force"
|
||||
"hostRequirements": {
|
||||
"storage": "64gb"
|
||||
},
|
||||
"dockerComposeFile": "../codespaces.yml"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,17 +3,19 @@
|
|||
"service": "macos",
|
||||
"containerEnv": {
|
||||
"VERSION": "11"
|
||||
},
|
||||
"forwardPorts": [8006],
|
||||
},
|
||||
"forwardPorts": [8006],
|
||||
"portsAttributes": {
|
||||
"8006": {
|
||||
"label": "Web",
|
||||
"onAutoForward": "notify"
|
||||
"onAutoForward": "openBrowser"
|
||||
}
|
||||
},
|
||||
"otherPortsAttributes": {
|
||||
"onAutoForward": "ignore"
|
||||
"onAutoForward": "silent"
|
||||
},
|
||||
"dockerComposeFile": "../codespaces.yml",
|
||||
"initializeCommand": "docker system prune --all --force"
|
||||
"hostRequirements": {
|
||||
"storage": "64gb"
|
||||
},
|
||||
"dockerComposeFile": "../codespaces.yml"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,17 +3,19 @@
|
|||
"service": "macos",
|
||||
"containerEnv": {
|
||||
"VERSION": "10"
|
||||
},
|
||||
"forwardPorts": [8006],
|
||||
},
|
||||
"forwardPorts": [8006],
|
||||
"portsAttributes": {
|
||||
"8006": {
|
||||
"label": "Web",
|
||||
"onAutoForward": "notify"
|
||||
"onAutoForward": "openBrowser"
|
||||
}
|
||||
},
|
||||
"otherPortsAttributes": {
|
||||
"onAutoForward": "ignore"
|
||||
"onAutoForward": "silent"
|
||||
},
|
||||
"dockerComposeFile": "../codespaces.yml",
|
||||
"initializeCommand": "docker system prune --all --force"
|
||||
"hostRequirements": {
|
||||
"storage": "64gb"
|
||||
},
|
||||
"dockerComposeFile": "../codespaces.yml"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
services:
|
||||
macos:
|
||||
image: dockurr/macos
|
||||
container_name: macos
|
||||
image: ghcr.io/dockur/macos
|
||||
environment:
|
||||
VERSION: "14"
|
||||
ALLOCATE: "Y"
|
||||
RAM_SIZE: "half"
|
||||
DISK_SIZE: "max"
|
||||
CPU_CORES: "max"
|
||||
|
|
|
|||
|
|
@ -3,17 +3,19 @@
|
|||
"service": "macos",
|
||||
"containerEnv": {
|
||||
"VERSION": "14"
|
||||
},
|
||||
"forwardPorts": [8006],
|
||||
},
|
||||
"forwardPorts": [8006],
|
||||
"portsAttributes": {
|
||||
"8006": {
|
||||
"label": "Web",
|
||||
"onAutoForward": "notify"
|
||||
"onAutoForward": "openBrowser"
|
||||
}
|
||||
},
|
||||
"otherPortsAttributes": {
|
||||
"onAutoForward": "ignore"
|
||||
"onAutoForward": "silent"
|
||||
},
|
||||
"dockerComposeFile": "codespaces.yml",
|
||||
"initializeCommand": "docker system prune --all --force"
|
||||
"hostRequirements": {
|
||||
"storage": "64gb"
|
||||
},
|
||||
"dockerComposeFile": "codespaces.yml"
|
||||
}
|
||||
|
|
|
|||
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
|
|
@ -22,7 +22,7 @@ jobs:
|
|||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 0
|
||||
-
|
||||
|
|
|
|||
2
.github/workflows/check.yml
vendored
2
.github/workflows/check.yml
vendored
|
|
@ -7,7 +7,7 @@ jobs:
|
|||
name: shellcheck
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/checkout@v5
|
||||
- name: Run ShellCheck
|
||||
uses: ludeeus/action-shellcheck@master
|
||||
env:
|
||||
|
|
|
|||
22
.github/workflows/hub.yml
vendored
22
.github/workflows/hub.yml
vendored
|
|
@ -12,15 +12,13 @@ jobs:
|
|||
dockerHubDescription:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout repo
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Docker Hub Description
|
||||
uses: peter-evans/dockerhub-description@v5
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
repository: ${{ secrets.DOCKERHUB_REPO }}
|
||||
short-description: ${{ github.event.repository.description }}
|
||||
readme-filepath: ./readme.md
|
||||
- uses: actions/checkout@v5
|
||||
-
|
||||
name: Docker Hub Description
|
||||
uses: peter-evans/dockerhub-description@v5
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
repository: ${{ secrets.DOCKERHUB_REPO }}
|
||||
short-description: ${{ github.event.repository.description }}
|
||||
readme-filepath: ./readme.md
|
||||
|
|
|
|||
66
.github/workflows/review.yml
vendored
66
.github/workflows/review.yml
vendored
|
|
@ -1,66 +0,0 @@
|
|||
on:
|
||||
pull_request:
|
||||
|
||||
name: "Review"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
checks: write
|
||||
|
||||
jobs:
|
||||
review:
|
||||
name: review
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Spelling
|
||||
uses: reviewdog/action-misspell@v1
|
||||
with:
|
||||
locale: "US"
|
||||
level: warning
|
||||
pattern: |
|
||||
*.md
|
||||
*.sh
|
||||
reporter: github-pr-review
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
-
|
||||
name: Hadolint
|
||||
uses: reviewdog/action-hadolint@v1
|
||||
with:
|
||||
level: warning
|
||||
reporter: github-pr-review
|
||||
hadolint_ignore: DL3008 DL3018 DL3020 DL3029 DL3059
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
-
|
||||
name: YamlLint
|
||||
uses: reviewdog/action-yamllint@v1
|
||||
with:
|
||||
level: warning
|
||||
reporter: github-pr-review
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
-
|
||||
name: ActionLint
|
||||
uses: reviewdog/action-actionlint@v1
|
||||
with:
|
||||
level: warning
|
||||
reporter: github-pr-review
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
-
|
||||
name: Shellformat
|
||||
uses: reviewdog/action-shfmt@v1
|
||||
with:
|
||||
level: warning
|
||||
shfmt_flags: "-i 2 -ci -bn"
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
-
|
||||
name: Shellcheck
|
||||
uses: reviewdog/action-shellcheck@v1
|
||||
with:
|
||||
level: warning
|
||||
reporter: github-pr-review
|
||||
shellcheck_flags: -x -e SC1091 -e SC2001 -e SC2002 -e SC2034 -e SC2064 -e SC2153 -e SC2317 -e SC2028
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
|
@ -12,7 +12,7 @@ RUN apk --update --no-cache add unzip && \
|
|||
rm -rf /tmp/* /var/tmp/* /var/cache/apk/*
|
||||
|
||||
FROM scratch AS runner
|
||||
COPY --from=qemux/qemu:7.29 / /
|
||||
COPY --from=qemux/qemu:7.25 / /
|
||||
|
||||
ARG VERSION_ARG="0.0"
|
||||
ARG VERSION_KVM_OPENCORE="v21"
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ services:
|
|||
##### Via Docker CLI:
|
||||
|
||||
```bash
|
||||
docker run -it --rm --name macos -e "VERSION=14" -p 8006:8006 --device=/dev/kvm --device=/dev/net/tun --cap-add NET_ADMIN -v "${PWD:-.}/macos:/storage" --stop-timeout 120 docker.io/dockurr/macos
|
||||
docker run -it --rm --name macos -e "VERSION=14" -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:
|
||||
|
|
@ -146,7 +146,7 @@ kubectl apply -f https://raw.githubusercontent.com/dockur/macos/refs/heads/maste
|
|||
```
|
||||
|
||||
> [!IMPORTANT]
|
||||
> If your system has an AMD processor (instead of Intel), it is not advisable to enable multiple cores before the installation is completed and you have verified that everything runs stable for a while. Because in many cases it will introduce issues, which are difficult to pinpoint if you do not have experience with its behavior on a single core first.
|
||||
> If your system has an AMD processor it is generally not advisable to enable multiple cores (at least not until macOS is installed and running correctly). It might introduce stability and performance problems, so proceed with caution.
|
||||
|
||||
### How do I assign an individual IP address to the container?
|
||||
|
||||
|
|
|
|||
18
src/boot.sh
18
src/boot.sh
|
|
@ -45,23 +45,15 @@ DEST="$STORAGE/$DEST"
|
|||
|
||||
if [ ! -s "$DEST.rom" ] || [ ! -f "$DEST.rom" ]; then
|
||||
[ ! -s "$OVMF/$ROM" ] || [ ! -f "$OVMF/$ROM" ] && error "UEFI boot file ($OVMF/$ROM) not found!" && exit 44
|
||||
if [[ "${LOGO:-}" == [Nn]* ]]; then
|
||||
cp "$OVMF/$ROM" "$DEST.tmp"
|
||||
else
|
||||
if ! /run/utk.bin "$OVMF/$ROM" replace_ffs LogoDXE "/var/www/img/${PROCESS,,}.ffs" save "$DEST.tmp"; then
|
||||
warn "failed to add custom logo to BIOS!"
|
||||
cp "$OVMF/$ROM" "$DEST.tmp"
|
||||
fi
|
||||
cp "$OVMF/$ROM" "$DEST.rom"
|
||||
if [[ "${LOGO:-}" != [Nn]* ]]; then
|
||||
/run/utk.bin "$DEST.rom" replace_ffs LogoDXE "/var/www/img/macos.ffs" save "$DEST.rom"
|
||||
fi
|
||||
mv "$DEST.tmp" "$DEST.rom"
|
||||
! setOwner "$DEST.rom" && error "Failed to set the owner for \"$DEST.rom\" !"
|
||||
fi
|
||||
|
||||
if [ ! -s "$DEST.vars" ] || [ ! -f "$DEST.vars" ]; then
|
||||
[ ! -s "$OVMF/$VARS" ] || [ ! -f "$OVMF/$VARS" ]&& error "UEFI vars file ($OVMF/$VARS) not found!" && exit 45
|
||||
cp "$OVMF/$VARS" "$DEST.tmp"
|
||||
mv "$DEST.tmp" "$DEST.vars"
|
||||
! setOwner "$DEST.vars" && error "Failed to set the owner for \"$DEST.vars\" !"
|
||||
cp "$OVMF/$VARS" "$DEST.vars"
|
||||
fi
|
||||
|
||||
BOOT_OPTS+=" -drive if=pflash,format=raw,readonly=on,file=$DEST.rom"
|
||||
|
|
@ -163,8 +155,6 @@ if [ ! -f "$IMG" ]; then
|
|||
|
||||
fi
|
||||
|
||||
! setOwner "$IMG" && error "Failed to set the owner for \"$IMG\" !"
|
||||
|
||||
BOOT_DRIVE_ID="OpenCore"
|
||||
|
||||
DISK_OPTS+=" -device virtio-blk-pci,drive=${BOOT_DRIVE_ID},bus=pcie.0,addr=0x5,bootindex=$BOOT_INDEX"
|
||||
|
|
|
|||
|
|
@ -155,10 +155,7 @@ install() {
|
|||
esac
|
||||
|
||||
rm -f "$dest"
|
||||
|
||||
if ! makeDir "$STORAGE"; then
|
||||
error "Failed to create directory \"$STORAGE\" !" && return 1
|
||||
fi
|
||||
mkdir -p "$STORAGE"
|
||||
|
||||
find "$STORAGE" -maxdepth 1 -type f \( -iname '*.rom' -or -iname '*.vars' \) -delete
|
||||
find "$STORAGE" -maxdepth 1 -type f \( -iname 'data.*' -or -iname 'macos.*' \) -delete
|
||||
|
|
@ -194,9 +191,7 @@ generateID() {
|
|||
UUID=$(cat /proc/sys/kernel/random/uuid 2> /dev/null || uuidgen --random)
|
||||
UUID="${UUID^^}"
|
||||
UUID="${UUID//[![:print:]]/}"
|
||||
|
||||
echo "$UUID" > "$file"
|
||||
! setOwner "$file" && error "Failed to set the owner for \"$file\" !"
|
||||
|
||||
return 0
|
||||
}
|
||||
|
|
@ -213,9 +208,7 @@ generateAddress() {
|
|||
# Generate Apple MAC address based on Docker container ID in hostname
|
||||
MAC=$(echo "$HOST" | md5sum | sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/00:16:cb:\3:\4:\5/')
|
||||
MAC="${MAC^^}"
|
||||
|
||||
echo "$MAC" > "$file"
|
||||
! setOwner "$file" && error "Failed to set the owner for \"$file\" !"
|
||||
|
||||
return 0
|
||||
}
|
||||
|
|
@ -246,9 +239,6 @@ generateSerial() {
|
|||
echo "$SN" > "$file"
|
||||
echo "$MLB" > "$file2"
|
||||
|
||||
! setOwner "$file" && error "Failed to set the owner for \"$file\" !"
|
||||
! setOwner "$file2" && error "Failed to set the owner for \"$file2\" !"
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
|
|
@ -272,7 +262,6 @@ if [ ! -f "$BASE_IMG" ] || [ ! -s "$BASE_IMG" ]; then
|
|||
|
||||
if [ ! -f "$BASE_IMG" ] || [ ! -s "$BASE_IMG" ]; then
|
||||
! install "$VERSION" "$BASE_IMG" && exit 34
|
||||
! setOwner "$BASE_IMG" && error "Failed to set the owner for \"$BASE_IMG\" !"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in a new issue