Skip to content

Repository files navigation

IDE Code Server

English | 简体中文

A comprehensive development environment Docker image based on code-server, pre-configured with multiple programming language runtimes and China mainland mirror acceleration.

Features

  • Base: codercom/code-server:latest
  • User: coder with passwordless sudo (su blocked)
  • Languages: Go, Python 3.13, Node.js, JDK 21, Ruby/Rails
  • Tools: git, curl, wget, vim, tmux, dnsutils (nslookup), yq, kubectl, gopls, delve, uv, conda, pnpm, yarn, Maven, claude-code
  • Middleware Clients: MySQL CLI, PostgreSQL CLI (psql), Redis CLI, Docker CLI, Kafka CLI

Quick Start

docker run -d \
--name ide-code-server \
-p 8080:8080 \
-v $(pwd)/project:/home/coder/project \
-e PASSWORD=yourpassword \
ghcr.io/your-username/ide-code-server:latest

Access at http://localhost:8080

Volume Mounts

Recommended External Mounts

For better persistence and performance, mount these directories externally:

Container PathPurposeDescription
/home/coder/projectWorkspaceMain workspace directory
/home/coder/.local/share/code-serverVS Code DataExtensions, settings, and user data
/home/coder/.npmnpm Cachenpm global cache
/home/coder/.local/share/pnpmpnpm Storepnpm package store
/home/coder/goGo PackagesGOPATH for user-installed Go packages
/home/coder/.cache/uvuv Cacheuv Python package cache
/home/coder/.cache/pippip Cachepip package cache
/home/coder/.m2/repositoryMaven RepoMaven local repository

Minimal Setup

docker run -d \
--name ide-code-server \
-p 8080:8080 \
-v $(pwd)/project:/home/coder/project \
-v $(pwd)/code-server:/home/coder/.local/share/code-server \
-e PASSWORD=yourpassword \
ghcr.io/your-username/ide-code-server:latest

Full Setup with All Mounts

docker run -d \
--name ide-code-server \
-p 8080:8080 \
-v $(pwd)/project:/home/coder/project \
-v $(pwd)/code-server:/home/coder/.local/share/code-server \
-v $(pwd)/npm:/home/coder/.npm \
-v $(pwd)/pnpm:/home/coder/.local/share/pnpm \
-v $(pwd)/go:/home/coder/go \
-v $(pwd)/cache/uv:/home/coder/.cache/uv \
-v $(pwd)/cache/pip:/home/coder/.cache/pip \
-v $(pwd)/m2:/home/coder/.m2/repository \
-e PASSWORD=yourpassword \
ghcr.io/your-username/ide-code-server:latest

Docker Compose

Minimal Configuration

services:
ide-code-server:
image: ghcr.io/your-username/ide-code-server:latestvolumes:
- ./project:/home/coder/project
- ./code-server:/home/coder/.local/share/code-serverports:
- "8080:8080"environment:
- PASSWORD=yourpasswordrestart: unless-stopped

Full Configuration with All Mounts

services:
ide-code-server:
image: ghcr.io/your-username/ide-code-server:latestvolumes:
# Workspace
- ./project:/home/coder/project# VS Code extensions and settings
- ./code-server:/home/coder/.local/share/code-server# Node.js package caches
- ./npm:/home/coder/.npm
- ./pnpm:/home/coder/.local/share/pnpm# Go packages (GOPATH)
- ./go:/home/coder/go# Python package caches
- ./cache/uv:/home/coder/.cache/uv
- ./cache/pip:/home/coder/.cache/pip# Maven local repository
- ./m2:/home/coder/.m2/repositoryports:
- "8080:8080"environment:
- PASSWORD=yourpasswordrestart: unless-stopped

Benefits of External Mounts

  1. VS Code Extensions (/home/coder/.local/share/code-server)

    • Extensions persist across container rebuilds
    • Share extensions between containers
    • Faster startup after rebuild
  2. Package Caches (/home/coder/.npm, /home/coder/.local/share/pnpm, etc.)

    • Avoid re-downloading packages
    • Share caches between containers
    • Faster dependency installation
  3. Language Packages (/home/coder/go, /home/coder/.m2/repository)

    • Persist globally installed packages
    • Go tools installed via go install
    • Maven dependencies cached locally

Mounting Entire /home/coder Directory

You can mount the entire /home/coder directory for maximum persistence:

docker run -d \
--name ide-code-server \
-p 8080:8080 \
-v $(pwd)/coder-home:/home/coder \
-e PASSWORD=yourpassword \
ghcr.io/your-username/ide-code-server:latest

Auto-Initialization

When /home/coder is mounted (especially as an empty directory), the container automatically initializes:

FilePurpose
.bashrcPATH restoration, rbenv initialization, and legacy rbenv path migration
.gemrcRuby China mirror configuration
.m2/settings.xmlMaven Aliyun mirror configuration
.config/pip/pip.confpip Tsinghua mirror configuration

Required directories are also created automatically. Legacy shell entries that reference /home/coder/.rbenv are automatically migrated to /opt/rbenv during startup.

System Tools (Not Affected by Mounts)

The following components are installed in system directories and remain available regardless of volume mounts:

ComponentLocationTools
Go Tools/opt/go-tools/bingopls, dlv, golangci-lint, goimports
Ruby (rbenv)/opt/rbenvruby, gem, rails, bundler
Python/conda/opt/condapython, pip, conda
JDK/opt/temurin-21-jdkjava, javac, jar
Maven/opt/apache-mavenmvn
Kafka/opt/kafkakafka-topics, kafka-console-consumer, kafka-console-producer

Installed Languages

LanguageVersionToolsMirror
Go1.26.1gopls, delve, golangci-lintgoproxy.cn
Python3.13uv, condapypi.tuna.tsinghua.edu.cn
Node.js22 LTSnpm, pnpm, yarnnpmmirror
JDK21Maven 3.9.11Aliyun
Ruby4.0.2Rails, BundlerRuby China

Build

docker build -t ide-code-server .

License

MIT

About

No description, website, or topics provided.

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages