-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[Feature Request] Add Docker Server Image for OpenCode Code Server #19474
Copy link
Copy link
Closed
andreclaudino/opencode
#1Labels
docsneeds:complianceThis means the issue will auto-close after 2 hours.This means the issue will auto-close after 2 hours.
Description
Summary
We propose adding official Docker images for running OpenCode as a headless server, enabling integration with external coding tools and creating a self-hosted code server environment.
Motivation
Having an official Docker image for OpenCode server would enable several use cases:
- Code Server Integration: Run OpenCode in a container and connect to it from VS Code, JetBrains IDEs, or other editors that support remote development
- Isolated Execution: Run OpenCode in an isolated environment without affecting the host system
- CI/CD Integration: Use OpenCode in automated pipelines and CI/CD workflows
- Multi-user Environments: Deploy OpenCode as a service in multi-user development environments
- Dev Containers: The image includes the Dev Container CLI, enabling seamless integration with VS Code Dev Containers
Proposed Solution
We have implemented Docker images with the following features:
- Two base variants: Debian Trixie and Alpine Linux for different size/performance needs
- Non-root user: Runs as
opencodeuser (UID 1000) with sudo access for package installation - Pre-installed tools: build-essential, git, git-lfs, Bun, uv, npx, npm, node, devcontainer CLI
- Volume mounts: Support for workspace, SSH keys, git config, and OpenCode configuration
- Health checks: Built-in health check endpoint
- Multi-arch support: linux/amd64 and linux/arm64
Example Usage
# Run the server
docker run -p 3000:3000 -v /path/to/workspace:/workspace ghcr.io/anomalyco/opencode:dev-debian
# With SSH keys for git
docker run -p 3000:3000 -v ~/.ssh:/home/opencode/.ssh ghcr.io/anomalyco/opencode:dev-debian
# Using docker-compose
services:
opencode:
image: ghcr.io/anomalyco/opencode:dev-debian
ports:
- "3000:3000"
volumes:
- ./workspace:/workspace
- ~/.ssh:/home/opencode/.ssh
- ~/.gitconfig:/home/opencode/.gitconfigDocumentation
Full documentation is available in multiple languages at docs/docker-server.md.
Implementation Status
A complete implementation is available in this PR including:
- Dockerfiles for both Debian and Alpine variants
- GitHub Actions workflow for automated builds to GHCR
- Build script for local development
- Comprehensive documentation in 22 languages
Tags
The images will be published with the following tags:
ghcr.io/anomalyco/opencode:<version>-debianghcr.io/anomalyco/opencode:<version>-alpineghcr.io/anomalyco/opencode:latest-debianghcr.io/anomalyco/opencode:latest-alpine
This issue is associated with PR #.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
docsneeds:complianceThis means the issue will auto-close after 2 hours.This means the issue will auto-close after 2 hours.