Operations 7 min read

Run the Latest OpenCode on macOS 11 Big Sur with Docker and Save $10,000

Faced with OpenCode dropping support for macOS 11, the author tried npm, legacy binaries, and source compilation without success, then installed Docker Desktop 4.24.2, pulled the OpenCode image, and created start‑stop scripts to run the tool locally, avoiding a costly hardware upgrade.

Architecture Breakthrough
Architecture Breakthrough
Architecture Breakthrough
Run the Latest OpenCode on macOS 11 Big Sur with Docker and Save $10,000

The author owns a 2013 MacBook Pro running macOS 11 Big Sur, which Apple no longer updates; OpenCode now requires macOS 13, and its pre‑compiled packages are built for that version, making a new Mac costing nearly ten thousand dollars the only apparent solution.

Three direct installation attempts all failed: using npm or the official installer, trying the opencode-darwin-amd64-baseline binary (claimed to support macOS 10 but actually not), and compiling the source from GitHub, which requires Bun—a runtime unavailable on the old OS.

The breakthrough was to install Docker Desktop 4.24.2, the last Docker release that runs on macOS 11, then pull the official OpenCode container image from GitHub Container Registry, rename it to opencode-docker, and verify the image appears twice with the same IMAGE ID, confirming no extra disk usage.

Running the container uses a command that mounts the current directory, sets the working directory, matches the host UID/GID, and defines HOME=/app to prevent OpenCode errors. The flags are explained: -v "$(pwd)":/app mounts the folder, -w /app sets the container’s workdir, -u "$(id -u):$(id -g)" runs as the current user, and -e HOME=/app points Home inside the container.

To simplify usage, the author created ~/.zsh/opencode.sh containing two functions. opencode() checks whether Docker Desktop is running, silently starts it with open -g /Applications/Docker.app if needed, waits for the daemon, then launches the OpenCode container with the same flags as above. stop‑opencode() uses osascript -e 'quit app "Docker"' to quit Docker gracefully and waits until the daemon stops.

After sourcing the script ( source ~/.zsh/opencode.sh), typing opencode in any directory automatically starts Docker, pulls the image if necessary, and drops the user into the OpenCode environment; stop‑opencode shuts down Docker and frees resources. The author notes the experience is not as smooth as a native install, but it enables continued use of OpenCode on an older Mac without purchasing a new machine.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

CLIDockerautomationmacOSOpenCodeBig Sur
Architecture Breakthrough
Written by

Architecture Breakthrough

Focused on fintech, sharing experiences in financial services, architecture technology, and R&D management.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.