|
| 1 | +# syntax=docker/dockerfile:1.17.1 |
| 2 | +# check=skip=all |
| 3 | + |
| 4 | +FROM ghcr.io/jianliang00/macos-base:26.3 |
| 5 | + |
| 6 | +# hadolint ignore=DL4006 -- container tool does not support SHELL directive |
| 7 | +# No network during build -- all dependencies are COPY'd as pre-built tarballs. |
| 8 | +# Run `scripts/runner.sh prepare` on the host to generate the build context. |
| 9 | + |
| 10 | +# Preserve the full default macOS PATH through all ENV directives |
| 11 | +ENV BASE_PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin" |
| 12 | + |
| 13 | +# Xcode Command Line Tools |
| 14 | +COPY CLTools.pkg /tmp/CLTools.tar |
| 15 | +RUN tar xf /tmp/CLTools.tar -C / \ |
| 16 | + && rm /tmp/CLTools.tar \ |
| 17 | + && xcode-select --switch /Library/Developer/CommandLineTools \ |
| 18 | + && echo "CLT installed at $(xcode-select -p)" |
| 19 | + |
| 20 | +# Homebrew + packages |
| 21 | +COPY homebrew.tar /tmp/homebrew.tar |
| 22 | +RUN /bin/mkdir -p /opt/homebrew \ |
| 23 | + && tar xf /tmp/homebrew.tar -C /opt/homebrew \ |
| 24 | + && rm /tmp/homebrew.tar |
| 25 | + |
| 26 | +# mise |
| 27 | +COPY mise.tar /tmp/mise.tar |
| 28 | +RUN /bin/mkdir -p /Users/Shared/.local/bin \ |
| 29 | + && tar xf /tmp/mise.tar -C /Users/Shared/.local/bin \ |
| 30 | + && rm /tmp/mise.tar |
| 31 | + |
| 32 | +# Node.js |
| 33 | +COPY node.tar /tmp/node.tar |
| 34 | +RUN /bin/mkdir -p /opt/node \ |
| 35 | + && tar xf /tmp/node.tar -C /opt/node \ |
| 36 | + && rm /tmp/node.tar |
| 37 | + |
| 38 | +# Deno |
| 39 | +COPY deno.tar /tmp/deno.tar |
| 40 | +RUN /bin/mkdir -p /opt/deno/bin \ |
| 41 | + && tar xf /tmp/deno.tar -C /opt/deno/bin \ |
| 42 | + && rm /tmp/deno.tar |
| 43 | + |
| 44 | +# Task |
| 45 | +COPY task.tar /tmp/task.tar |
| 46 | +RUN /bin/mkdir -p /opt/task/bin \ |
| 47 | + && tar xf /tmp/task.tar -C /opt/task/bin \ |
| 48 | + && rm /tmp/task.tar |
| 49 | + |
| 50 | +# Rust toolchain |
| 51 | +COPY rust.tar /tmp/rust.tar |
| 52 | +RUN /bin/mkdir -p /Users/Shared/.rustup /Users/Shared/.cargo \ |
| 53 | + && tar xf /tmp/rust.tar -C /Users/Shared \ |
| 54 | + && rm /tmp/rust.tar \ |
| 55 | + && cd /Users/Shared/.cargo/bin \ |
| 56 | + && for link in $(find . -type l); do \ |
| 57 | + target=$(readlink "$link"); \ |
| 58 | + case "$target" in */rustup) ln -sf /Users/Shared/.cargo/bin/rustup "$link" ;; esac; \ |
| 59 | + done |
| 60 | + |
| 61 | +# Cargo tools (tauri-cli, cargo-binstall) |
| 62 | +COPY cargo-tools.tar /tmp/cargo-tools.tar |
| 63 | +RUN tar xf /tmp/cargo-tools.tar -C /Users/Shared/.cargo/bin \ |
| 64 | + && rm /tmp/cargo-tools.tar |
| 65 | + |
| 66 | +# GitHub Actions runner |
| 67 | +COPY actions-runner.tar.gz /tmp/actions-runner.tar.gz |
| 68 | +WORKDIR /opt/actions-runner |
| 69 | +RUN tar xzf /tmp/actions-runner.tar.gz \ |
| 70 | + && rm /tmp/actions-runner.tar.gz |
| 71 | + |
| 72 | +# Set final PATH with all tools |
| 73 | +ENV PATH="/Users/Shared/.cargo/bin:/Users/Shared/.local/bin:/Users/Shared/.local/share/mise/shims:/opt/homebrew/bin:/opt/homebrew/sbin:/opt/node/bin:/opt/deno/bin:/opt/task/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin" |
| 74 | +ENV RUSTUP_HOME="/Users/Shared/.rustup" \ |
| 75 | + CARGO_HOME="/Users/Shared/.cargo" |
| 76 | + |
| 77 | +COPY entrypoint.sh /opt/actions-runner/entrypoint.sh |
| 78 | +RUN chmod +x /opt/actions-runner/entrypoint.sh |
| 79 | +ENTRYPOINT ["/opt/actions-runner/entrypoint.sh"] |
0 commit comments