Last active
December 28, 2025 15:27
-
-
Save Nithanim/f8ec12c11179a32cf2bf14fc04a1dcc8 to your computer and use it in GitHub Desktop.
Opencode Docker Simple Sandbox
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| services: | |
| dev-env: | |
| build: . | |
| volumes: | |
| - ~/project/:/workspace # Your project folder | |
| - ~/.config/opencode:/root/.config/opencode:ro # Your config (read-only) | |
| - ~/.local/share/opencode/:/root/.local/share/opencode/ | |
| - dev-tools:/opt/tools # Persistent volume for installed tools | |
| - dev-cache:/root/.cache # Cache for package managers | |
| # - dev-cache-maven:/root/.m2 | |
| working_dir: /workspace | |
| stdin_open: true | |
| tty: true | |
| command: /bin/bash | |
| volumes: | |
| dev-tools: | |
| dev-cache: | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM ubuntu:22.04 | |
| # Install essentials | |
| RUN apt-get update && apt-get install -y \ | |
| curl \ | |
| wget \ | |
| git \ | |
| build-essential \ | |
| python3 \ | |
| python3-pip \ | |
| sudo | |
| # && rm -rf /var/lib/apt/lists/* | |
| ENV NVM_VERSION=0.40.3 | |
| ENV NODE_VERSION=22.18.0 | |
| RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh | bash | |
| # standard location | |
| ENV NVM_DIR=/root/.nvm | |
| RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION} | |
| RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION} | |
| RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION} | |
| ENV PATH="${NVM_DIR}/versions/node/v${NODE_VERSION}/bin/:${PATH}" | |
| RUN apt-get install -y openjdk-21-jdk-headless maven | |
| RUN npm i -g opencode-ai@1.0.134 | |
| #RUN npm i -g @openai/codex | |
| # Add tools directory to PATH | |
| ENV PATH="/opt/tools/bin:${PATH}" | |
| # Allow installing packages without prompts | |
| #ENV DEBIAN_FRONTEND=noninteractive | |
| WORKDIR /workspace | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment