# opencode **Repository Path**: beyond-prototype/opencode ## Basic Information - **Project Name**: opencode - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-02-13 - **Last Updated**: 2026-02-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## Opencode Pull docker image ```sh docker pull ghcr.io/anomalyco/opencode ``` Check opencode paths ```sh docker run -it --rm --entrypoint sh ghcr.io/anomalyco/opencode opencode debug paths / # opencode -v 1.1.64 / # opencode debug paths home /root data /root/.local/share/opencode bin /root/.local/share/opencode/bin log /root/.local/share/opencode/log cache /root/.cache/opencode config /root/.config/opencode state /root/.local/state/opencode ``` Check ollama model ```sh % docker exec -it ollama bash root@96469b53f1a0:/# ollama list NAME ID SIZE MODIFIED qwen2.5-coder:7b dae161e27b0e 4.7 GB 24 hours ago ``` Create local configuration for Ollama ```sh mkdir -p ${HOME}/.config/opencode touch ${HOME}/.config/opencode/opencode.json cat > ${HOME}/.config/opencode/opencode.json << 'EOF' { "$schema": "https://opencode.ai/config.json", "provider": { "ollama": { "npm": "@ai-sdk/openai-compatible", "name": "Ollama (local)", "options": { "baseURL": "http://localhost:11434/v1" }, "models": { "qwen2.5-coder:7b": { "name": "Qwen2.5 Coder 7B (local)" } } } } } EOF ``` Start Opencode (use `--net host`) ```sh docker run -it --net host --rm -v $(pwd):/workspace -w /workspace -v ${HOME}/.config/opencode:/root/.config/opencode --entrypoint sh ghcr.io/anomalyco/opencode ``` Use command `/models` to select model **Qwen2.5 Coder 7B (local)** create sh script to start up docker container ```sh docker run -it --net host -v $(pwd):/workspace -w /workspace -v ${HOME}/.config/opencode:/root/.config/opencode --entrypoint sh ghcr.io/anomalyco/opencode ``` the container name should be extrated from the $PWD folder name, if the container already exist and user to choise options whether user wants to create a new one to replace or start the existing one ## OpenCode Start Clone repo ```sh mkdir ~/workplace cd ~/workplace && git clone https://gitee.com/beyond-prototype/opencode.git chmod +x ~/workplace/opencode/opencode ``` Add an `opencode` alias to `~/.zshrc` - Open `~/.zshrc`: **open -a "Visual Studio Code" ~/.zshrc** - Add `alias opencode=~/workplace/opencode/opencode.sh` - Compile `source ~/.zshrc` Go to any project folder and run `opencode` to start container. ```sh xwp@macpro workplace % cd age-viewer xwp@macpro age-viewer % opencode Container name: age-viewer Container 'age-viewer' already exists. 1) Replace (remove and create new) 2) Start existing container 3) Remove existing container Choose option [1/2/3]: 1 Removing existing container... age-viewer Starting new container 'age-viewer'... ``` ## Intall git bash docker-cli openjdk21 ```Dockerfile FROM ghcr.io/anomalyco/opencode RUN alpine_version=$(cat /etc/alpine-release | cut -d. -f1-2) && \ sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \ echo "https://mirrors.aliyun.com/alpine/v${alpine_version}/community" >> /etc/apk/repositories RUN apk update && \ apk add --no-cache git bash docker-cli openjdk21 nodejs npm && \ rm -rf /var/cache/apk/* ENTRYPOINT ["/bin/sh"] ``` ```sh docker build -t opencode-full . ``` ```sh xwp@macpro opencode % opencode Container name: opencode Container 'opencode' already exists. 1) Replace (remove and create new) 2) Start existing container 3) Remove existing container Choose option [1/2/3]: 1 Removing existing container... opencode Starting new container 'opencode'... /workspace # java -version openjdk version "21.0.10" 2026-01-20 OpenJDK Runtime Environment (build 21.0.10+7-alpine-r0) OpenJDK 64-Bit Server VM (build 21.0.10+7-alpine-r0, mixed mode, sharing) /workspace # /workspace # /workspace # git -v git version 2.52.0 /workspace # node -v v24.13.0 /workspace # npm -v 11.6.3 /workspace # bash -version GNU bash, version 5.3.3(1)-release (aarch64-alpine-linux-musl) ``` ## Docker In Docker ```sh docker run -it \ --net host \ -v "$PWD:/workspace" \ -w /workspace \ -v "$HOME/.config/opencode:/root/.config/opencode" \ -v /var/run/docker.sock:/var/run/docker.sock \ --entrypoint sh \ --name "$container_name" \ opencode-full ``` Notes - `/var/run/docker.sock` gives access to the Docker daemon.