OpenCode Plus Docker image with zsh, git, curl, uv and Python 3.14 preinstalled
823
This repository contains the build configuration for brokenjade/opencode_plus, a Docker image based on ghcr.io/anomalyco/opencode with additional development tools preinstalled.
OpenCode Plus is a Docker image based on OpenCode with the following development tools preinstalled:
zshgitcurluvUV_LINK_MODE=copy configured by defaultIt is intended for running OpenCode with a local project directory mounted from your host machine. In that respect, it works similarly to a Docker sandbox.
Before starting, make sure you have:
OPENCODE_SERVER_USERNAME and OPENCODE_SERVER_PASSWORD set in your terminal environmentOpenCode may require internet access when starting or when performing tasks that use online services. Check your connection before launching it. In environments where required services are unreachable, including some network configurations in China, OpenCode may fail to start or work correctly.
In a terminal, navigate to your project directory:
cd /path/to/your/project
Choose a host port. In the example below, OpenCode is available on port 4086. You can change this to any unused port.
Start the container:
port=4086 && docker run -d \
--name "$(basename "$PWD")" \
-v "$(pwd):$(pwd)" \
-p "${port}:4096" \
-e OPENCODE_SERVER_USERNAME="$OPENCODE_SERVER_USERNAME" \
-e OPENCODE_SERVER_PASSWORD="$OPENCODE_SERVER_PASSWORD" \
brokenjade/opencode_plus \
web --hostname 0.0.0.0 --port 4096
or you can wrap it up into a bash function and save into ~/.aliases
docker-opencode() {
# Default port to 4096 on host if no argument is provided
local port="${1:-4096}"
docker run -d \
--name "$(basename "$PWD")" \
-v "$(pwd):$(pwd)" \
-v "$(pwd)/.container_bk/.local/share/opencode:/root/.local/share/opencode" \
-v "$(pwd)/.container_bk/.config/opencode:/root/.config/opencode" \
-p "${port}:4096" \
-e OPENCODE_SERVER_USERNAME="$OPENCODE_SERVER_USERNAME" \
-e OPENCODE_SERVER_PASSWORD="$OPENCODE_SERVER_PASSWORD" \
brokenjade/opencode_plus web --hostname 0.0.0.0 --port 4096
}
#When using it, you can simple call or a port number without it(using default 4096)
docker-opencode 4088
Note: This backs up the OpenCode database to your project's .container_bk folder. It is useful for rebuilding the container from scratch without losing your OpenCode history and configurations. Additionally, OPENCODE_SERVER_USERNAME and OPENCODE_SERVER_PASSWORD are optional; if you do not want to use them, you can remove these two lines or set them up in your host environment.
Open OpenCode in your browser:
http://localhost:4096
If you selected a different value for port, replace 4086 in the URL with the port you chose.
The container name is automatically set to the name of your current project directory.
After starting the container once, return to the same project directory and restart it with:
docker restart "$(basename "$PWD")"
Then open the same address in your browser:
http://localhost:4096
From the project directory, run:
docker exec -it "$(basename "$PWD")" zsh -c 'cd "'"$PWD"'"; source .venv/bin/activate; exec zsh'
This opens a zsh shell inside the container, changes to your mounted project directory, and activates the project’s .venv virtual environment.
To leave the container shell, run:
exit
Compared with a Docker sandbox, this image is designed to be more adaptable to a regular development workflow:
zsh terminal in the container at any time.uv, are already available.A sandbox can be convenient for isolated, temporary tasks, but it may be less suitable when you need a reusable, customized environment. In addition, Docker Sandbox image servers may be inaccessible from China due to network restrictions.
The workflow is a GitHub Actions job that:
DOCKERHUB_USERNAME and DOCKERHUB_TOKEN repository secrets.ghcr.io/anomalyco/opencode with the recorded base-image digest label on the previously published brokenjade/opencode_plus:latest image.linux/amd64 and linux/arm64, using QEMU and Buildx:latest and :<run-number>buildcache tag, used for faster incremental rebuildsTo build and publish your own customized image with this workflow, add the following secrets to the GitHub repository:
| Secret | Value |
|---|---|
DOCKERHUB_USERNAME | Your Docker Hub username |
DOCKERHUB_TOKEN | A Docker Hub access token, or your account password |
docker build -t brokenjade/opencode_plus:local .
Content type
Image
Digest
sha256:afaffc194…
Size
203.2 MB
Last updated
6 days ago
docker pull brokenjade/opencode_plus