docker.recipes

OneDev

intermediate

All-in-one DevOps platform with Git and CI/CD.

Overview

OneDev is an all-in-one DevOps platform that combines Git repository management, continuous integration and deployment, code review workflows, issue tracking, and project wikis into a single self-hosted solution. Originally developed as an open-source alternative to platforms like GitLab and GitHub Enterprise, OneDev distinguishes itself by using Kubernetes YAML syntax for pipeline definitions and providing built-in Docker integration for job execution. The platform emphasizes simplicity and performance while offering enterprise-grade features like branch protection rules, service desk functionality, and comprehensive audit logging. This Docker configuration deploys OneDev as a standalone server with direct access to the host's Docker daemon, enabling it to spawn containers for CI/CD job execution. The setup exposes both HTTP and SSH interfaces, allowing developers to interact with Git repositories through web browsers or command-line tools. OneDev's architecture eliminates the need for separate components like Redis or PostgreSQL by using an embedded database and file-based storage, making it particularly suitable for organizations wanting a complete DevOps solution without complex infrastructure management. Small to medium-sized development teams, startups seeking cost-effective DevOps tooling, and organizations requiring full control over their source code and CI/CD processes will find this configuration valuable. OneDev excels in environments where teams want GitHub or GitLab-like functionality without vendor lock-in or subscription costs, while maintaining the flexibility to customize workflows and integrate with existing Docker-based development environments.

Key Features

  • Git repository hosting with advanced branching strategies and merge request workflows
  • Kubernetes YAML-based CI/CD pipeline syntax with visual pipeline editor
  • Built-in Docker job executor that spawns containers for build and deployment tasks
  • Integrated code review system with inline comments and approval workflows
  • Service desk functionality for customer support ticket management
  • Symbol navigation and code search across repositories with language-aware indexing
  • Issue tracking with customizable fields, workflows, and board views
  • Built-in package registry for Docker images and Maven artifacts

Common Use Cases

  • 1Small development teams migrating from GitHub or GitLab to self-hosted solutions
  • 2Startups building Docker-based applications requiring integrated DevOps workflows
  • 3Organizations needing air-gapped development environments with full CI/CD capabilities
  • 4Educational institutions teaching DevOps practices with hands-on Git and pipeline management
  • 5Open source projects requiring comprehensive code review and contributor management
  • 6Companies consolidating multiple DevOps tools into a single platform to reduce complexity
  • 7Development teams practicing trunk-based development with automated testing pipelines

Prerequisites

  • Minimum 4GB RAM recommended for OneDev server with active CI/CD pipelines
  • Docker daemon access required for job execution (Docker socket mounted)
  • Available ports 6610 (HTTP) and 6611 (SSH Git) for external access
  • At least 20GB disk space for repositories, build artifacts, and Docker images
  • Basic understanding of Kubernetes YAML syntax for pipeline configuration
  • Knowledge of Git workflows and branching strategies for team collaboration

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 onedev:
3 image: 1dev/server:latest
4 container_name: onedev
5 restart: unless-stopped
6 volumes:
7 - onedev_data:/opt/onedev
8 - /var/run/docker.sock:/var/run/docker.sock
9 ports:
10 - "6610:6610"
11 - "6611:6611"
12
13volumes:
14 onedev_data:

.env Template

.env
1# Configure via web interface

Usage Notes

  1. 1Docs: https://docs.onedev.io/
  2. 2Access at http://localhost:6610 - create admin on first visit
  3. 3Port 6611 for SSH git operations
  4. 4Built-in CI/CD runs jobs in Docker containers
  5. 5Code review, issue tracking, and wiki included
  6. 6Kubernetes YAML pipeline syntax (different from GitLab)

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 onedev:
5 image: 1dev/server:latest
6 container_name: onedev
7 restart: unless-stopped
8 volumes:
9 - onedev_data:/opt/onedev
10 - /var/run/docker.sock:/var/run/docker.sock
11 ports:
12 - "6610:6610"
13 - "6611:6611"
14
15volumes:
16 onedev_data:
17EOF
18
19# 2. Create the .env file
20cat > .env << 'EOF'
21# Configure via web interface
22EOF
23
24# 3. Start the services
25docker compose up -d
26
27# 4. View logs
28docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/onedev/run | bash

Troubleshooting

  • Permission denied accessing Docker socket: Ensure OneDev container runs with proper Docker group permissions or use Docker-in-Docker setup
  • SSH Git clone fails on port 6611: Verify SSH key configuration in OneDev user settings and check firewall rules
  • Build jobs fail with resource constraints: Increase Docker daemon memory limits or configure job resource quotas in OneDev settings
  • OneDev web interface returns 502 errors: Check container logs for database corruption and verify volume permissions for onedev_data
  • Pipeline jobs stuck in pending status: Restart OneDev container to reset job executor and check Docker daemon connectivity

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space