mirror of
https://github.com/dockur/macos.git
synced 2026-03-11 08:34:24 +00:00
Compare commits
76 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
297714126c | ||
|
|
056dfdd026 | ||
|
|
4cdd13585d | ||
|
|
1b3f506bbe | ||
|
|
9288c856e4 | ||
|
|
67a172743c | ||
|
|
333948ef19 | ||
|
|
dd59b97af6 | ||
|
|
5c26b95ee4 | ||
|
|
b3450d11eb | ||
|
|
61ff166d16 | ||
|
|
211601d12b | ||
|
|
e032e349ee | ||
|
|
2f0e962edd | ||
|
|
05a699ba9a | ||
|
|
72468237d3 | ||
|
|
20068d21a3 | ||
|
|
6672deb920 | ||
|
|
fb7cd67691 | ||
|
|
c3d9de925c | ||
|
|
b1d47f113b | ||
|
|
8def1efbc0 | ||
|
|
9a8afcf237 | ||
|
|
e461eba7b3 | ||
|
|
3935b89941 | ||
|
|
9c8458d30b | ||
|
|
61d30d1672 | ||
|
|
0daaa39547 | ||
|
|
2d21f714c3 | ||
|
|
d3c2d44855 | ||
|
|
cfd279b7e1 | ||
|
|
8423965cf8 | ||
|
|
4c529524ad | ||
|
|
7f1202725c | ||
|
|
6c6f929adf | ||
|
|
feac11ef9a | ||
|
|
9d19aeeaf3 | ||
|
|
edaa2d2bfc | ||
|
|
a92a2cb0a0 | ||
|
|
944d58a982 | ||
|
|
eda63efc6e | ||
|
|
45b966703e | ||
|
|
1f31b50ff8 | ||
|
|
05dad712f3 | ||
|
|
4e804a1ef9 | ||
|
|
5b25e4c64d | ||
|
|
f9ea2f2781 | ||
|
|
35c7419044 | ||
|
|
8e7572b1ff | ||
|
|
125f14164b | ||
|
|
1ed6749ccd | ||
|
|
fc99211115 | ||
|
|
d4add50eb4 | ||
|
|
c787b8dd13 | ||
|
|
54e08a9425 | ||
|
|
733266fd6c | ||
|
|
08ac3ab823 | ||
|
|
a737399811 | ||
|
|
109b84fd6f | ||
|
|
fb044b9158 | ||
|
|
a82c3b58fd | ||
|
|
0cd494674c | ||
|
|
7d85112d12 | ||
|
|
f15a2d6ae5 | ||
|
|
827f458cae | ||
|
|
27a66f4748 | ||
|
|
9fb20e6ef5 | ||
|
|
e1977b9cdc | ||
|
|
db7d2d32a4 | ||
|
|
fa9319e74e | ||
|
|
b6a318f6e9 | ||
|
|
d93c75b979 | ||
|
|
9115d132f6 | ||
|
|
88c3f6219e | ||
|
|
e0a357091d | ||
|
|
69b79d9ba9 |
23 changed files with 379 additions and 85 deletions
|
|
@ -1,6 +0,0 @@
|
||||||
{
|
|
||||||
"name": "macos",
|
|
||||||
"service": "macos",
|
|
||||||
"forwardPorts": [8006],
|
|
||||||
"dockerComposeFile": "compose.yml"
|
|
||||||
}
|
|
||||||
19
.devcontainer/010 - macOS Sequoia/devcontainer.json
Normal file
19
.devcontainer/010 - macOS Sequoia/devcontainer.json
Normal 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"
|
||||||
|
}
|
||||||
19
.devcontainer/030 - macOS Ventura/devcontainer.json
Normal file
19
.devcontainer/030 - macOS Ventura/devcontainer.json
Normal 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"
|
||||||
|
}
|
||||||
19
.devcontainer/040 - macOS Monterey/devcontainer.json
Normal file
19
.devcontainer/040 - macOS Monterey/devcontainer.json
Normal 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"
|
||||||
|
}
|
||||||
19
.devcontainer/050 - macOS Big Sur/devcontainer.json
Normal file
19
.devcontainer/050 - macOS Big Sur/devcontainer.json
Normal 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"
|
||||||
|
}
|
||||||
19
.devcontainer/060 - macOS Catalina/devcontainer.json
Normal file
19
.devcontainer/060 - macOS Catalina/devcontainer.json
Normal 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"
|
||||||
|
}
|
||||||
21
.devcontainer/codespaces.yml
Normal file
21
.devcontainer/codespaces.yml
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
services:
|
||||||
|
macos:
|
||||||
|
container_name: macos
|
||||||
|
image: ghcr.io/dockur/macos
|
||||||
|
environment:
|
||||||
|
RAM_SIZE: "half"
|
||||||
|
DISK_SIZE: "max"
|
||||||
|
CPU_CORES: "max"
|
||||||
|
devices:
|
||||||
|
- /dev/kvm
|
||||||
|
- /dev/net/tun
|
||||||
|
cap_add:
|
||||||
|
- NET_ADMIN
|
||||||
|
ports:
|
||||||
|
- 8006:8006
|
||||||
|
- 5900:5900/tcp
|
||||||
|
- 5900:5900/udp
|
||||||
|
volumes:
|
||||||
|
- ./macos:/storage
|
||||||
|
restart: on-failure
|
||||||
|
stop_grace_period: 2m
|
||||||
19
.devcontainer/devcontainer.json
Normal file
19
.devcontainer/devcontainer.json
Normal 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"
|
||||||
|
}
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
.dockerignore
|
.dockerignore
|
||||||
|
.devcontainer
|
||||||
.git
|
.git
|
||||||
.github
|
.github
|
||||||
.gitignore
|
.gitignore
|
||||||
|
|
|
||||||
2
.github/ISSUE_TEMPLATE/1-issue.yml
vendored
2
.github/ISSUE_TEMPLATE/1-issue.yml
vendored
|
|
@ -21,6 +21,7 @@ body:
|
||||||
attributes:
|
attributes:
|
||||||
label: Docker compose
|
label: Docker compose
|
||||||
description: The compose file (or otherwise the `docker run` command used).
|
description: The compose file (or otherwise the `docker run` command used).
|
||||||
|
render: yaml
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: textarea
|
- type: textarea
|
||||||
|
|
@ -28,6 +29,7 @@ body:
|
||||||
attributes:
|
attributes:
|
||||||
label: Docker log
|
label: Docker log
|
||||||
description: The logfile of the container (as shown by `docker logs macos`).
|
description: The logfile of the container (as shown by `docker logs macos`).
|
||||||
|
render: shell
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: textarea
|
- type: textarea
|
||||||
|
|
|
||||||
2
.github/ISSUE_TEMPLATE/3-bug.yml
vendored
2
.github/ISSUE_TEMPLATE/3-bug.yml
vendored
|
|
@ -23,6 +23,7 @@ body:
|
||||||
attributes:
|
attributes:
|
||||||
label: Docker compose
|
label: Docker compose
|
||||||
description: The compose file (or otherwise the `docker run` command used).
|
description: The compose file (or otherwise the `docker run` command used).
|
||||||
|
render: yaml
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: textarea
|
- type: textarea
|
||||||
|
|
@ -30,6 +31,7 @@ body:
|
||||||
attributes:
|
attributes:
|
||||||
label: Docker log
|
label: Docker log
|
||||||
description: The logfile of the container (as shown by `docker logs macos`).
|
description: The logfile of the container (as shown by `docker logs macos`).
|
||||||
|
render: shell
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: textarea
|
- type: textarea
|
||||||
|
|
|
||||||
12
.github/workflows/build.yml
vendored
12
.github/workflows/build.yml
vendored
|
|
@ -2,16 +2,6 @@ name: Build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
paths-ignore:
|
|
||||||
- '**/*.md'
|
|
||||||
- '**/*.yml'
|
|
||||||
- '.gitignore'
|
|
||||||
- '.dockerignore'
|
|
||||||
- '.github/**'
|
|
||||||
- '.github/workflows/**'
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: build
|
group: build
|
||||||
|
|
@ -32,7 +22,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
-
|
-
|
||||||
|
|
|
||||||
9
.github/workflows/check.yml
vendored
9
.github/workflows/check.yml
vendored
|
|
@ -7,14 +7,19 @@ jobs:
|
||||||
name: shellcheck
|
name: shellcheck
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
- name: Run ShellCheck
|
- name: Run ShellCheck
|
||||||
uses: ludeeus/action-shellcheck@master
|
uses: ludeeus/action-shellcheck@master
|
||||||
env:
|
env:
|
||||||
SHELLCHECK_OPTS: -x --source-path=src -e SC1091 -e SC2001 -e SC2002 -e SC2034 -e SC2064 -e SC2153 -e SC2317 -e SC2028
|
SHELLCHECK_OPTS: -x --source-path=src -e SC1091 -e SC2001 -e SC2002 -e SC2034 -e SC2064 -e SC2153 -e SC2317 -e SC2028
|
||||||
- name: Lint Dockerfile
|
- name: Lint Dockerfile
|
||||||
uses: hadolint/hadolint-action@v3.1.0
|
uses: hadolint/hadolint-action@v3.3.0
|
||||||
with:
|
with:
|
||||||
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$"
|
||||||
|
|
|
||||||
22
.github/workflows/hub.yml
vendored
22
.github/workflows/hub.yml
vendored
|
|
@ -12,13 +12,15 @@ jobs:
|
||||||
dockerHubDescription:
|
dockerHubDescription:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
-
|
||||||
-
|
name: Checkout repo
|
||||||
name: Docker Hub Description
|
uses: actions/checkout@v6
|
||||||
uses: peter-evans/dockerhub-description@v4
|
-
|
||||||
with:
|
name: Docker Hub Description
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
uses: peter-evans/dockerhub-description@v5
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
with:
|
||||||
repository: ${{ secrets.DOCKERHUB_REPO }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
short-description: ${{ github.event.repository.description }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
readme-filepath: ./readme.md
|
repository: ${{ secrets.DOCKERHUB_REPO }}
|
||||||
|
short-description: ${{ github.event.repository.description }}
|
||||||
|
readme-filepath: ./readme.md
|
||||||
|
|
|
||||||
66
.github/workflows/review.yml
vendored
Normal file
66
.github/workflows/review.yml
vendored
Normal 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 }}
|
||||||
5
.github/workflows/test.yml
vendored
5
.github/workflows/test.yml
vendored
|
|
@ -1,11 +1,6 @@
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
|
||||||
- '**/*.sh'
|
|
||||||
- '.github/workflows/test.yml'
|
|
||||||
- '.github/workflows/check.yml'
|
|
||||||
- 'Dockerfile'
|
|
||||||
|
|
||||||
name: "Test"
|
name: "Test"
|
||||||
permissions: {}
|
permissions: {}
|
||||||
|
|
|
||||||
12
Dockerfile
12
Dockerfile
|
|
@ -1,4 +1,6 @@
|
||||||
FROM --platform=$BUILDPLATFORM alpine:3.21 AS builder
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
|
FROM --platform=$BUILDPLATFORM alpine:3.22 AS builder
|
||||||
|
|
||||||
ARG VERSION_OPENCORE="1.0.4"
|
ARG VERSION_OPENCORE="1.0.4"
|
||||||
ARG REPO_OPENCORE="https://github.com/acidanthera/OpenCorePkg"
|
ARG REPO_OPENCORE="https://github.com/acidanthera/OpenCorePkg"
|
||||||
|
|
@ -10,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.08 / /
|
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"
|
||||||
|
|
@ -25,8 +27,6 @@ ARG DEBCONF_NONINTERACTIVE_SEEN="true"
|
||||||
RUN set -eu && \
|
RUN set -eu && \
|
||||||
apt-get update && \
|
apt-get update && \
|
||||||
apt-get --no-install-recommends -y install \
|
apt-get --no-install-recommends -y install \
|
||||||
xxd \
|
|
||||||
fdisk \
|
|
||||||
mtools && \
|
mtools && \
|
||||||
apt-get clean && \
|
apt-get clean && \
|
||||||
echo "$VERSION_ARG" > /run/version && \
|
echo "$VERSION_ARG" > /run/version && \
|
||||||
|
|
@ -47,9 +47,9 @@ ADD $REPO_KVM_OPENCORE/releases/download/$VERSION_KVM_OPENCORE/OpenCore-$VERSION
|
||||||
VOLUME /storage
|
VOLUME /storage
|
||||||
EXPOSE 5900 8006
|
EXPOSE 5900 8006
|
||||||
|
|
||||||
ENV VERSION="13"
|
ENV VERSION="14"
|
||||||
ENV RAM_SIZE="4G"
|
ENV RAM_SIZE="4G"
|
||||||
ENV CPU_CORES="2"
|
ENV CPU_CORES="1"
|
||||||
ENV DISK_SIZE="64G"
|
ENV DISK_SIZE="64G"
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/bin/tini", "-s", "/run/entry.sh"]
|
ENTRYPOINT ["/usr/bin/tini", "-s", "/run/entry.sh"]
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ services:
|
||||||
image: dockurr/macos
|
image: dockurr/macos
|
||||||
container_name: macos
|
container_name: macos
|
||||||
environment:
|
environment:
|
||||||
VERSION: "13"
|
VERSION: "14"
|
||||||
devices:
|
devices:
|
||||||
- /dev/kvm
|
- /dev/kvm
|
||||||
- /dev/net/tun
|
- /dev/net/tun
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ spec:
|
||||||
image: dockurr/macos
|
image: dockurr/macos
|
||||||
env:
|
env:
|
||||||
- name: VERSION
|
- name: VERSION
|
||||||
value: "13"
|
value: "14"
|
||||||
- name: DISK_SIZE
|
- name: DISK_SIZE
|
||||||
value: "64G"
|
value: "64G"
|
||||||
ports:
|
ports:
|
||||||
|
|
|
||||||
25
readme.md
25
readme.md
|
|
@ -1,4 +1,4 @@
|
||||||
<h1 align="center">OSX<br />
|
<h1 align="center">macOS<br />
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<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>
|
<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>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
</div></h1>
|
</div></h1>
|
||||||
|
|
||||||
OSX (macOS) inside a Docker container.
|
MacOS inside a Docker container.
|
||||||
|
|
||||||
## Features ✨
|
## Features ✨
|
||||||
|
|
||||||
|
|
@ -30,7 +30,7 @@ services:
|
||||||
image: dockurr/macos
|
image: dockurr/macos
|
||||||
container_name: macos
|
container_name: macos
|
||||||
environment:
|
environment:
|
||||||
VERSION: "13"
|
VERSION: "14"
|
||||||
devices:
|
devices:
|
||||||
- /dev/kvm
|
- /dev/kvm
|
||||||
- /dev/net/tun
|
- /dev/net/tun
|
||||||
|
|
@ -49,7 +49,7 @@ services:
|
||||||
##### Via Docker CLI:
|
##### Via Docker CLI:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
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
|
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:
|
||||||
|
|
@ -78,17 +78,23 @@ kubectl apply -f https://raw.githubusercontent.com/dockur/macos/refs/heads/maste
|
||||||
|
|
||||||
- When prompted where you want to install it, select the disk you created previously.
|
- When prompted where you want to install it, select the disk you created previously.
|
||||||
|
|
||||||
- After all files are copied, select your region, language, and account settings.
|
- After all files are copied, select your region, language, and keyboard settings.
|
||||||
|
|
||||||
|
- When the `Migration Assistant` wants to transfer data, select `Not now` (bottom left).
|
||||||
|
|
||||||
|
- On the `Apple ID` screen, select `Set Up Later` (bottom left) and then proceed using `Skip`.
|
||||||
|
|
||||||
|
- On the `Create a Computer Account` screen, fill in a username and password and `Continue`.
|
||||||
|
|
||||||
Enjoy your brand new machine, and don't forget to star this repo!
|
Enjoy your brand new machine, and don't forget to star this repo!
|
||||||
|
|
||||||
### How do I select the version of macOS?
|
### How do I select the version of macOS?
|
||||||
|
|
||||||
By default, macOS 13 (Ventura) will be installed, but you can add the `VERSION` environment variable in order to specify an alternative:
|
By default, macOS 14 (Sonoma) will be installed, but you can add the `VERSION` environment variable in order to specify an alternative:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
environment:
|
environment:
|
||||||
VERSION: "13"
|
VERSION: "15"
|
||||||
```
|
```
|
||||||
|
|
||||||
Select from the values below:
|
Select from the values below:
|
||||||
|
|
@ -129,7 +135,7 @@ kubectl apply -f https://raw.githubusercontent.com/dockur/macos/refs/heads/maste
|
||||||
|
|
||||||
### How do I change the amount of CPU or RAM?
|
### How do I change the amount of CPU or RAM?
|
||||||
|
|
||||||
By default, the container will be allowed to use a maximum of 2 CPU cores and 4 GB of RAM.
|
By default, macOS will be allowed to use a single CPU core and 4 GB of RAM.
|
||||||
|
|
||||||
If you want to adjust this, you can specify the desired amount using the following environment variables:
|
If you want to adjust this, you can specify the desired amount using the following environment variables:
|
||||||
|
|
||||||
|
|
@ -139,6 +145,9 @@ kubectl apply -f https://raw.githubusercontent.com/dockur/macos/refs/heads/maste
|
||||||
CPU_CORES: "4"
|
CPU_CORES: "4"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
> [!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.
|
||||||
|
|
||||||
### How do I assign an individual IP address to the container?
|
### 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.
|
By default, the container uses bridge networking, which shares the IP address with the host.
|
||||||
|
|
|
||||||
66
src/boot.sh
66
src/boot.sh
|
|
@ -2,13 +2,17 @@
|
||||||
set -Eeuo pipefail
|
set -Eeuo pipefail
|
||||||
|
|
||||||
# Docker environment variables
|
# Docker environment variables
|
||||||
: "${BOOT_MODE:="macos"}" # Boot mode
|
|
||||||
: "${SECURE:="off"}" # Secure boot
|
: "${SECURE:="off"}" # Secure boot
|
||||||
|
: "${BOOT_MODE:="macos"}" # Boot mode
|
||||||
|
|
||||||
BOOT_DESC=""
|
BOOT_DESC=""
|
||||||
BOOT_OPTS=""
|
BOOT_OPTS=""
|
||||||
OVMF="/usr/share/OVMF"
|
OVMF="/usr/share/OVMF"
|
||||||
|
|
||||||
|
msg="Configuring boot..."
|
||||||
|
html "$msg"
|
||||||
|
[[ "$DEBUG" == [Yy1]* ]] && echo "$msg"
|
||||||
|
|
||||||
case "${HEIGHT,,}" in
|
case "${HEIGHT,,}" in
|
||||||
"1080" )
|
"1080" )
|
||||||
DEST="$PROCESS"
|
DEST="$PROCESS"
|
||||||
|
|
@ -41,12 +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
|
||||||
|
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
|
||||||
|
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"
|
||||||
|
|
@ -148,17 +163,43 @@ 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"
|
||||||
DISK_OPTS+=" -drive file=$IMG,id=$BOOT_DRIVE_ID,format=raw,cache=unsafe,readonly=on,if=none"
|
DISK_OPTS+=" -drive file=$IMG,id=$BOOT_DRIVE_ID,format=raw,cache=unsafe,readonly=on,if=none"
|
||||||
|
|
||||||
CPU_VENDOR=$(lscpu | awk '/Vendor ID/{print $3}')
|
CPU_VENDOR=$(lscpu | awk '/Vendor ID/{print $3}')
|
||||||
DEFAULT_FLAGS="vendor=GenuineIntel,vmware-cpuid-freq=on,-pdpe1gb"
|
DEFAULT_FLAGS="vendor=GenuineIntel,vmx=off,vmware-cpuid-freq=on,-pdpe1gb"
|
||||||
|
|
||||||
|
if [[ "$CPU_VENDOR" == "AuthenticAMD" || "${KVM:-}" == [Nn]* ]]; then
|
||||||
|
|
||||||
|
if [ -z "${CPU_MODEL:-}" ]; then
|
||||||
|
|
||||||
|
case "${VERSION,,}" in
|
||||||
|
"ventura" | "13"* )
|
||||||
|
CPU_MODEL="Haswell-noTSX" ;;
|
||||||
|
"monterey" | "12"* )
|
||||||
|
CPU_MODEL="Haswell-noTSX" ;;
|
||||||
|
"bigsur" | "big-sur" | "11"* )
|
||||||
|
CPU_MODEL="Haswell-noTSX" ;;
|
||||||
|
"catalina" | "10"* )
|
||||||
|
CPU_MODEL="Haswell-noTSX" ;;
|
||||||
|
*)
|
||||||
|
CPU_MODEL="Skylake-Client-v4"
|
||||||
|
DEFAULT_FLAGS+=",-spec-ctrl"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${KVM:-}" == [Nn]* ]] || [[ "${ARCH,,}" != "amd64" ]] || [[ "$OSTYPE" =~ ^darwin ]]; then
|
||||||
|
DEFAULT_FLAGS+=",-pcid,-tsc-deadline,-invpcid,-xsavec,-xsaves,+ssse3,+sse4.2,+popcnt,+avx,+avx2,+aes,+fma,+bmi1,+bmi2,+smep,+xsave,+xsaveopt,+xgetbv1,+movbe,+rdrand,check"
|
||||||
|
else
|
||||||
|
DEFAULT_FLAGS+=",+pcid,+ssse3,+sse4.2,+popcnt,+avx,+avx2,+aes,+fma,+bmi1,+bmi2,+smep,+xsave,+xsavec,+xsaves,+xsaveopt,+xgetbv1,+movbe,+rdrand,check"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "$CPU_VENDOR" != "GenuineIntel" ]] || [[ "${KVM:-}" == [Nn]* ]]; then
|
|
||||||
[ -z "${CPU_MODEL:-}" ] && CPU_MODEL="Haswell-noTSX"
|
|
||||||
DEFAULT_FLAGS+=",+pcid,+ssse3,+sse4.2,+popcnt,+avx,+avx2,+aes,+fma,+bmi1,+bmi2,+smep,+xsave,+xsavec,+xsaveopt,+xgetbv1,+movbe,+rdrand,check"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "${CPU_FLAGS:-}" ]; then
|
if [ -z "${CPU_FLAGS:-}" ]; then
|
||||||
|
|
@ -178,14 +219,11 @@ else
|
||||||
result=$(<"$CLOCK")
|
result=$(<"$CLOCK")
|
||||||
result="${result//[![:print:]]/}"
|
result="${result//[![:print:]]/}"
|
||||||
case "${result,,}" in
|
case "${result,,}" in
|
||||||
"${CLOCKSOURCE,,}" ) ;;
|
"${CLOCKSOURCE,,}" )
|
||||||
"kvm-clock" )
|
if [[ "$CPU_VENDOR" == "GenuineIntel" && "$CPU_CORES" == "1" && "${KVM:-}" != [Nn]* ]]; then
|
||||||
if [[ "$CPU_VENDOR" != "GenuineIntel" ]] && [[ "${CPU_CORES,,}" == "2" ]]; then
|
CPU_CORES="2"
|
||||||
warn "Restricted processor to a single core because nested KVM virtualization was detected!"
|
|
||||||
CPU_CORES="1"
|
|
||||||
else
|
|
||||||
warn "Nested KVM virtualization detected, this might cause issues running macOS!"
|
|
||||||
fi ;;
|
fi ;;
|
||||||
|
"kvm-clock" ) warn "Nested KVM virtualization detected, this might cause issues running macOS!" ;;
|
||||||
"hyperv_clocksource_tsc_page" ) info "Nested Hyper-V virtualization detected, this might cause issues running macOS!" ;;
|
"hyperv_clocksource_tsc_page" ) info "Nested Hyper-V virtualization detected, this might cause issues running macOS!" ;;
|
||||||
"hpet" ) warn "unsupported clock source detected: '$result'. Please set host clock source to '$CLOCKSOURCE', otherwise it will cause issues running macOS!" ;;
|
"hpet" ) warn "unsupported clock source detected: '$result'. Please set host clock source to '$CLOCKSOURCE', otherwise it will cause issues running macOS!" ;;
|
||||||
*) warn "unexpected clock source detected: '$result'. Please set host clock source to '$CLOCKSOURCE', otherwise it will cause issues running macOS!" ;;
|
*) warn "unexpected clock source detected: '$result'. Please set host clock source to '$CLOCKSOURCE', otherwise it will cause issues running macOS!" ;;
|
||||||
|
|
|
||||||
|
|
@ -9,15 +9,19 @@ set -Eeuo pipefail
|
||||||
|
|
||||||
cd /run
|
cd /run
|
||||||
|
|
||||||
|
. start.sh # Startup hook
|
||||||
. utils.sh # Load functions
|
. utils.sh # Load functions
|
||||||
. reset.sh # Initialize system
|
. reset.sh # Initialize system
|
||||||
|
. server.sh # Start webserver
|
||||||
. install.sh # Get the OSX images
|
. install.sh # Get the OSX images
|
||||||
. disk.sh # Initialize disks
|
. disk.sh # Initialize disks
|
||||||
. display.sh # Initialize graphics
|
. display.sh # Initialize graphics
|
||||||
. 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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,14 +7,13 @@ set -Eeuo pipefail
|
||||||
: "${MLB:=""}" # Board serial
|
: "${MLB:=""}" # Board serial
|
||||||
: "${MAC:=""}" # MAC address
|
: "${MAC:=""}" # MAC address
|
||||||
: "${UUID:=""}" # Unique ID
|
: "${UUID:=""}" # Unique ID
|
||||||
|
: "${VERSION:=""}" # OSX Version
|
||||||
: "${WIDTH:="1920"}" # Horizontal
|
: "${WIDTH:="1920"}" # Horizontal
|
||||||
: "${HEIGHT:="1080"}" # Vertical
|
: "${HEIGHT:="1080"}" # Vertical
|
||||||
: "${VERSION:="13"}" # OSX Version
|
|
||||||
: "${MODEL:="iMacPro1,1"}" # Device model
|
: "${MODEL:="iMacPro1,1"}" # Device model
|
||||||
|
|
||||||
BASE_IMG_ID="InstallMedia"
|
BASE_IMG_ID="InstallMedia"
|
||||||
BASE_IMG="$STORAGE/base.dmg"
|
BASE_IMG="$STORAGE/base.dmg"
|
||||||
BASE_VERSION="$STORAGE/$PROCESS.version"
|
|
||||||
|
|
||||||
function getRandom() {
|
function getRandom() {
|
||||||
local length="${1}"
|
local length="${1}"
|
||||||
|
|
@ -29,7 +28,23 @@ function getRandom() {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
function downloadImage() {
|
delay() {
|
||||||
|
|
||||||
|
local i
|
||||||
|
local delay="$1"
|
||||||
|
local msg="Retrying failed download in X seconds..."
|
||||||
|
|
||||||
|
info "${msg/X/$delay}"
|
||||||
|
|
||||||
|
for i in $(seq "$delay" -1 1); do
|
||||||
|
html "${msg/X/$i}"
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
function download() {
|
||||||
local info=""
|
local info=""
|
||||||
local dest="$1"
|
local dest="$1"
|
||||||
local board="$2"
|
local board="$2"
|
||||||
|
|
@ -113,12 +128,15 @@ function downloadImage() {
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
download() {
|
install() {
|
||||||
|
|
||||||
local board
|
local board
|
||||||
local version="$1"
|
local version="$1"
|
||||||
|
local dest="$2"
|
||||||
|
|
||||||
case "${version,,}" in
|
case "${version,,}" in
|
||||||
|
"tahoe" | "26"* | "16"* )
|
||||||
|
board="Mac-CFF7D910A743CAAF" ;;
|
||||||
"sequoia" | "15"* )
|
"sequoia" | "15"* )
|
||||||
board="Mac-937A206F2EE63C01" ;;
|
board="Mac-937A206F2EE63C01" ;;
|
||||||
"sonoma" | "14"* )
|
"sonoma" | "14"* )
|
||||||
|
|
@ -136,15 +154,31 @@ download() {
|
||||||
return 1 ;;
|
return 1 ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [ -f "/boot.dmg" ]; then
|
rm -f "$dest"
|
||||||
cp "/boot.dmg" "$BASE_IMG"
|
|
||||||
else
|
if ! makeDir "$STORAGE"; then
|
||||||
local file="/BaseSystem.dmg"
|
error "Failed to create directory \"$STORAGE\" !" && return 1
|
||||||
! downloadImage "$file" "$board" "$version" && exit 60
|
|
||||||
mv -f "$file" "$BASE_IMG"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$version" > "$BASE_VERSION"
|
find "$STORAGE" -maxdepth 1 -type f \( -iname '*.rom' -or -iname '*.vars' \) -delete
|
||||||
|
find "$STORAGE" -maxdepth 1 -type f \( -iname 'data.*' -or -iname 'macos.*' \) -delete
|
||||||
|
|
||||||
|
if [ -f "/boot.dmg" ]; then
|
||||||
|
cp "/boot.dmg" "$dest"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
local file="$STORAGE/boot.dmg"
|
||||||
|
|
||||||
|
if ! download "$file" "$board" "$version"; then
|
||||||
|
delay 5
|
||||||
|
if ! download "$file" "$board" "$version"; then
|
||||||
|
rm -f "$file"
|
||||||
|
exit 60
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
mv -f "$file" "$dest"
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -160,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
|
||||||
}
|
}
|
||||||
|
|
@ -177,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
|
||||||
}
|
}
|
||||||
|
|
@ -208,22 +246,35 @@ 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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if [[ "${VERSION}" == \"*\" || "${VERSION}" == \'*\' ]]; then
|
||||||
|
VERSION="${VERSION:1:-1}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
VERSION=$(expr "$VERSION" : "^\ *\(.*[^ ]\)\ *$")
|
||||||
|
|
||||||
|
if [ -z "$VERSION" ]; then
|
||||||
|
|
||||||
|
VERSION="14"
|
||||||
|
warn "no value specified for the VERSION variable, defaulting to \"${VERSION}\"."
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -f "$BASE_IMG" ] || [ ! -s "$BASE_IMG" ]; then
|
if [ ! -f "$BASE_IMG" ] || [ ! -s "$BASE_IMG" ]; then
|
||||||
! download "$VERSION" && exit 34
|
|
||||||
fi
|
|
||||||
|
|
||||||
STORED_VERSION=""
|
STORAGE="$STORAGE/${VERSION,,}"
|
||||||
if [ -f "$BASE_VERSION" ]; then
|
BASE_IMG="$STORAGE/base.dmg"
|
||||||
STORED_VERSION=$(<"$BASE_VERSION")
|
|
||||||
STORED_VERSION="${STORED_VERSION//[![:print:]]/}"
|
if [ ! -f "$BASE_IMG" ] || [ ! -s "$BASE_IMG" ]; then
|
||||||
fi
|
! install "$VERSION" "$BASE_IMG" && exit 34
|
||||||
|
! setOwner "$BASE_IMG" && error "Failed to set the owner for \"$BASE_IMG\" !"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$VERSION" != "$STORED_VERSION" ]; then
|
|
||||||
info "Different version detected, switching base image from \"$STORED_VERSION\" to \"$VERSION\""
|
|
||||||
! download "$VERSION" && exit 34
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! generateID; then
|
if ! generateID; then
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue