Compare commits

..

25 commits

Author SHA1 Message Date
Kroese
297714126c
build: Update QEMU base image to v7.29 (#377)
Some checks failed
Update / dockerHubDescription (push) Has been cancelled
2025-11-22 05:00:34 +01:00
renovate[bot]
056dfdd026
chore(deps): update actions/checkout action to v6 (#375) 2025-11-21 12:35:52 +01:00
Kroese
4cdd13585d
fix: Continue booting when Fiano fails (#376)
Add error handling for logo replacement in BIOS
2025-11-21 12:33:10 +01:00
Kroese
1b3f506bbe
fix: Update Workspaces configuration (#374) 2025-11-14 06:33:48 +01:00
Kroese
9288c856e4
build: Update QEMU base image to v7.28 (#372) 2025-11-12 07:07:54 +01:00
Kroese
67a172743c
build: Use Github token (#366) 2025-10-29 14:05:31 +01:00
Kroese
333948ef19
fix: Inherit owner from parent folder (#359) 2025-10-22 04:03:24 +02:00
Kroese
dd59b97af6
build: Add code quality checks (#363) 2025-10-22 01:02:41 +02:00
Kroese
5c26b95ee4
build: Update QEMU base image to v7.27 (#362) 2025-10-21 23:19:57 +02:00
Kroese
b3450d11eb
docs: Update docker run command (#361) 2025-10-21 23:15:38 +02:00
Kroese
61ff166d16
build: Add review workflow for shell formatting (#360) 2025-10-21 22:38:09 +02:00
Kroese
211601d12b
build: Update QEMU base image to v7.26 (#358) 2025-10-19 18:02:33 +02:00
Kroese
e032e349ee
feat: Improve Github Codespaces configuration (#357) 2025-10-19 12:48:57 +02:00
Kroese
2f0e962edd
feat: Improve Github Codespaces configuration (#356) 2025-10-19 10:40:37 +02:00
Kroese
05a699ba9a
feat: Improve Github Codespaces configuration (#355) 2025-10-19 01:11:57 +02:00
Kroese
72468237d3
fix: Remove version variable in Codespaces (#354) 2025-10-17 19:02:01 +02:00
Kroese
20068d21a3
fix: Remove hostRequirements in Codespaces (#353) 2025-10-17 18:57:16 +02:00
Kroese
6672deb920
fix: Use temporary file when extracting ROM (#352) 2025-10-17 17:18:21 +02:00
Kroese
fb7cd67691
feat: Improve Github Codespaces configuration (#351) 2025-10-17 13:35:52 +02:00
Kroese
c3d9de925c
build: Update QEMU base image version to v7.25 (#350) 2025-10-17 13:33:28 +02:00
Kroese
b1d47f113b
feat: Load memory module (#349) 2025-10-17 13:31:46 +02:00
Kroese
8def1efbc0
build: Validate JSON and YML files (#348) 2025-10-17 10:05:33 +02:00
Kroese
9a8afcf237
feat: Make macOS version selectable in Codespaces (#347) 2025-10-16 08:55:31 +02:00
Kroese
e461eba7b3
feat: Improve Github Codespaces configuration (#346) 2025-10-16 00:01:30 +02:00
Kroese
3935b89941
feat: Improve Github Codespaces configuration (#345) 2025-10-15 23:45:21 +02:00
18 changed files with 233 additions and 29 deletions

View file

@ -1,6 +0,0 @@
{
"name": "macos",
"service": "macos",
"forwardPorts": [8006],
"dockerComposeFile": ".github/codespaces.yml"
}

View file

@ -0,0 +1,19 @@
{
"name": "macOS 15 (Sequoia)",
"service": "macos",
"containerEnv": {
"VERSION": "15"
},
"forwardPorts": [8006],
"portsAttributes": {
"8006": {
"label": "Web",
"onAutoForward": "notify"
}
},
"otherPortsAttributes": {
"onAutoForward": "ignore"
},
"dockerComposeFile": "../codespaces.yml",
"initializeCommand": "docker system prune --all --force"
}

View file

@ -0,0 +1,19 @@
{
"name": "macOS 13 (Ventura)",
"service": "macos",
"containerEnv": {
"VERSION": "13"
},
"forwardPorts": [8006],
"portsAttributes": {
"8006": {
"label": "Web",
"onAutoForward": "notify"
}
},
"otherPortsAttributes": {
"onAutoForward": "ignore"
},
"dockerComposeFile": "../codespaces.yml",
"initializeCommand": "docker system prune --all --force"
}

View file

@ -0,0 +1,19 @@
{
"name": "macOS 12 (Monterey)",
"service": "macos",
"containerEnv": {
"VERSION": "12"
},
"forwardPorts": [8006],
"portsAttributes": {
"8006": {
"label": "Web",
"onAutoForward": "notify"
}
},
"otherPortsAttributes": {
"onAutoForward": "ignore"
},
"dockerComposeFile": "../codespaces.yml",
"initializeCommand": "docker system prune --all --force"
}

View file

@ -0,0 +1,19 @@
{
"name": "macOS 11 (Big Sur)",
"service": "macos",
"containerEnv": {
"VERSION": "11"
},
"forwardPorts": [8006],
"portsAttributes": {
"8006": {
"label": "Web",
"onAutoForward": "notify"
}
},
"otherPortsAttributes": {
"onAutoForward": "ignore"
},
"dockerComposeFile": "../codespaces.yml",
"initializeCommand": "docker system prune --all --force"
}

View file

@ -0,0 +1,19 @@
{
"name": "macOS 10 (Catalina)",
"service": "macos",
"containerEnv": {
"VERSION": "10"
},
"forwardPorts": [8006],
"portsAttributes": {
"8006": {
"label": "Web",
"onAutoForward": "notify"
}
},
"otherPortsAttributes": {
"onAutoForward": "ignore"
},
"dockerComposeFile": "../codespaces.yml",
"initializeCommand": "docker system prune --all --force"
}

View file

@ -1,10 +1,9 @@
services: services:
macos: macos:
image: dockurr/macos
container_name: macos container_name: macos
image: ghcr.io/dockur/macos
environment: environment:
VERSION: "14" RAM_SIZE: "half"
RAM_SIZE: "max"
DISK_SIZE: "max" DISK_SIZE: "max"
CPU_CORES: "max" CPU_CORES: "max"
devices: devices:

View file

@ -0,0 +1,19 @@
{
"name": "macOS 14 (Sonoma)",
"service": "macos",
"containerEnv": {
"VERSION": "14"
},
"forwardPorts": [8006],
"portsAttributes": {
"8006": {
"label": "Web",
"onAutoForward": "notify"
}
},
"otherPortsAttributes": {
"onAutoForward": "ignore"
},
"dockerComposeFile": "codespaces.yml",
"initializeCommand": "docker system prune --all --force"
}

View file

@ -1,4 +1,5 @@
.dockerignore .dockerignore
.devcontainer
.git .git
.github .github
.gitignore .gitignore

View file

@ -22,7 +22,7 @@ jobs:
steps: steps:
- -
name: Checkout name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v6
with: with:
fetch-depth: 0 fetch-depth: 0
- -

View file

@ -7,7 +7,7 @@ jobs:
name: shellcheck name: shellcheck
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- name: Run ShellCheck - name: Run ShellCheck
uses: ludeeus/action-shellcheck@master uses: ludeeus/action-shellcheck@master
env: env:
@ -18,3 +18,8 @@ jobs:
dockerfile: Dockerfile dockerfile: Dockerfile
ignore: DL3008,DL3018,DL3020,DL3029,DL3059 ignore: DL3008,DL3018,DL3020,DL3029,DL3059
failure-threshold: warning failure-threshold: warning
-
name: Validate JSON and YML files
uses: GrantBirki/json-yaml-validate@v4
with:
yaml_exclude_regex: ".*\\kubernetes\\.yml$"

View file

@ -12,7 +12,9 @@ jobs:
dockerHubDescription: dockerHubDescription:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v5 -
name: Checkout repo
uses: actions/checkout@v6
- -
name: Docker Hub Description name: Docker Hub Description
uses: peter-evans/dockerhub-description@v5 uses: peter-evans/dockerhub-description@v5

66
.github/workflows/review.yml vendored Normal file
View file

@ -0,0 +1,66 @@
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 }}

View file

@ -12,7 +12,7 @@ RUN apk --update --no-cache add unzip && \
rm -rf /tmp/* /var/tmp/* /var/cache/apk/* rm -rf /tmp/* /var/tmp/* /var/cache/apk/*
FROM scratch AS runner FROM scratch AS runner
COPY --from=qemux/qemu:7.24 / / COPY --from=qemux/qemu:7.29 / /
ARG VERSION_ARG="0.0" ARG VERSION_ARG="0.0"
ARG VERSION_KVM_OPENCORE="v21" ARG VERSION_KVM_OPENCORE="v21"

View file

@ -49,7 +49,7 @@ services:
##### Via Docker CLI: ##### Via Docker CLI:
```bash ```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 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 docker.io/dockurr/macos
``` ```
##### Via Kubernetes: ##### Via Kubernetes:
@ -146,7 +146,7 @@ kubectl apply -f https://raw.githubusercontent.com/dockur/macos/refs/heads/maste
``` ```
> [!IMPORTANT] > [!IMPORTANT]
> 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. > 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.
### How do I assign an individual IP address to the container? ### How do I assign an individual IP address to the container?

View file

@ -45,15 +45,23 @@ DEST="$STORAGE/$DEST"
if [ ! -s "$DEST.rom" ] || [ ! -f "$DEST.rom" ]; then if [ ! -s "$DEST.rom" ] || [ ! -f "$DEST.rom" ]; then
[ ! -s "$OVMF/$ROM" ] || [ ! -f "$OVMF/$ROM" ] && error "UEFI boot file ($OVMF/$ROM) not found!" && exit 44 [ ! -s "$OVMF/$ROM" ] || [ ! -f "$OVMF/$ROM" ] && error "UEFI boot file ($OVMF/$ROM) not found!" && exit 44
cp "$OVMF/$ROM" "$DEST.rom" if [[ "${LOGO:-}" == [Nn]* ]]; then
if [[ "${LOGO:-}" != [Nn]* ]]; then cp "$OVMF/$ROM" "$DEST.tmp"
/run/utk.bin "$DEST.rom" replace_ffs LogoDXE "/var/www/img/macos.ffs" save "$DEST.rom" 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 fi
fi
mv "$DEST.tmp" "$DEST.rom"
! setOwner "$DEST.rom" && error "Failed to set the owner for \"$DEST.rom\" !"
fi fi
if [ ! -s "$DEST.vars" ] || [ ! -f "$DEST.vars" ]; then if [ ! -s "$DEST.vars" ] || [ ! -f "$DEST.vars" ]; then
[ ! -s "$OVMF/$VARS" ] || [ ! -f "$OVMF/$VARS" ]&& error "UEFI vars file ($OVMF/$VARS) not found!" && exit 45 [ ! -s "$OVMF/$VARS" ] || [ ! -f "$OVMF/$VARS" ]&& error "UEFI vars file ($OVMF/$VARS) not found!" && exit 45
cp "$OVMF/$VARS" "$DEST.vars" cp "$OVMF/$VARS" "$DEST.tmp"
mv "$DEST.tmp" "$DEST.vars"
! setOwner "$DEST.vars" && error "Failed to set the owner for \"$DEST.vars\" !"
fi fi
BOOT_OPTS+=" -drive if=pflash,format=raw,readonly=on,file=$DEST.rom" BOOT_OPTS+=" -drive if=pflash,format=raw,readonly=on,file=$DEST.rom"
@ -155,6 +163,8 @@ if [ ! -f "$IMG" ]; then
fi fi
! setOwner "$IMG" && error "Failed to set the owner for \"$IMG\" !"
BOOT_DRIVE_ID="OpenCore" BOOT_DRIVE_ID="OpenCore"
DISK_OPTS+=" -device virtio-blk-pci,drive=${BOOT_DRIVE_ID},bus=pcie.0,addr=0x5,bootindex=$BOOT_INDEX" DISK_OPTS+=" -device virtio-blk-pci,drive=${BOOT_DRIVE_ID},bus=pcie.0,addr=0x5,bootindex=$BOOT_INDEX"

View file

@ -19,7 +19,9 @@ cd /run
. network.sh # Initialize network . network.sh # Initialize network
. boot.sh # Configure boot . boot.sh # Configure boot
. proc.sh # Initialize processor . proc.sh # Initialize processor
. memory.sh # Check available memory
. config.sh # Configure arguments . config.sh # Configure arguments
. finish.sh # Finish initialization
trap - ERR trap - ERR

View file

@ -155,7 +155,10 @@ install() {
esac esac
rm -f "$dest" rm -f "$dest"
mkdir -p "$STORAGE"
if ! makeDir "$STORAGE"; then
error "Failed to create directory \"$STORAGE\" !" && return 1
fi
find "$STORAGE" -maxdepth 1 -type f \( -iname '*.rom' -or -iname '*.vars' \) -delete find "$STORAGE" -maxdepth 1 -type f \( -iname '*.rom' -or -iname '*.vars' \) -delete
find "$STORAGE" -maxdepth 1 -type f \( -iname 'data.*' -or -iname 'macos.*' \) -delete find "$STORAGE" -maxdepth 1 -type f \( -iname 'data.*' -or -iname 'macos.*' \) -delete
@ -191,7 +194,9 @@ generateID() {
UUID=$(cat /proc/sys/kernel/random/uuid 2> /dev/null || uuidgen --random) UUID=$(cat /proc/sys/kernel/random/uuid 2> /dev/null || uuidgen --random)
UUID="${UUID^^}" UUID="${UUID^^}"
UUID="${UUID//[![:print:]]/}" UUID="${UUID//[![:print:]]/}"
echo "$UUID" > "$file" echo "$UUID" > "$file"
! setOwner "$file" && error "Failed to set the owner for \"$file\" !"
return 0 return 0
} }
@ -208,7 +213,9 @@ generateAddress() {
# Generate Apple MAC address based on Docker container ID in hostname # Generate Apple MAC address based on Docker container ID in hostname
MAC=$(echo "$HOST" | md5sum | sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/00:16:cb:\3:\4:\5/') MAC=$(echo "$HOST" | md5sum | sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/00:16:cb:\3:\4:\5/')
MAC="${MAC^^}" MAC="${MAC^^}"
echo "$MAC" > "$file" echo "$MAC" > "$file"
! setOwner "$file" && error "Failed to set the owner for \"$file\" !"
return 0 return 0
} }
@ -239,6 +246,9 @@ generateSerial() {
echo "$SN" > "$file" echo "$SN" > "$file"
echo "$MLB" > "$file2" 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 return 0
} }
@ -262,6 +272,7 @@ if [ ! -f "$BASE_IMG" ] || [ ! -s "$BASE_IMG" ]; then
if [ ! -f "$BASE_IMG" ] || [ ! -s "$BASE_IMG" ]; then if [ ! -f "$BASE_IMG" ] || [ ! -s "$BASE_IMG" ]; then
! install "$VERSION" "$BASE_IMG" && exit 34 ! install "$VERSION" "$BASE_IMG" && exit 34
! setOwner "$BASE_IMG" && error "Failed to set the owner for \"$BASE_IMG\" !"
fi fi
fi fi