A fully-featured VS Code running in a container, pre-configured with Node.js, Python, Rust, and automatic GitHub repository integration.
- VS Code in browser - Full VS Code experience accessible via web browser
- Pre-installed tools - Node.js 20, Python 3, pip, Rust toolchain, Cargo
- GitHub integration - Automatic git configuration and repository cloning
- Seamless git operations - Built-in GitHub authentication for push/pull/fetch
- Persistent workspace - Your code and settings persist across container restarts
docker build -t open-code-server .Open your browser and navigate to: https://localhost:8443
Default password: password
| Variable | Description | Default |
|---|---|---|
PUID |
User ID for file permissions | 1000 |
PGID |
Group ID for file permissions | 1000 |
TZ |
Timezone | Etc/UTC |
PASSWORD |
Access password for code-server | password |
DEFAULT_WORKSPACE |
Default workspace directory | /config/workspace |
| Variable | Description | Example |
|---|---|---|
GITHUB_TOKEN |
Personal access token for authentication | ghp_xxxxxxxxxxxx |
GITHUB_REPOSITORY |
Repository to clone (format: username/repo) | myuser/myproject |
GIT_USERNAME |
Git author name | John Doe |
GIT_EMAIL |
Git author email | john@example.com |
When the container starts:
- Git Configuration - Sets global git username and email
- Repository Clone - If
/config/workspaceis empty, clones the specified GitHub repository - Authentication - Configures git remote with embedded token for authenticated operations
- Permission Setup - Ensures correct ownership for the workspace directory
- Code Server Launch - Starts the code-server application
The container automatically handles GitHub authentication by embedding your access token in the git remote URL. This enables:
git push- Push changes to your repositorygit pull- Pull updates from the repositorygit fetch- Fetch remote changes- All other git operations requiring authentication
- Go to GitHub Settings → Developer settings → Personal access tokens
- Click "Generate new token" (classic)
- Select scopes:
repo(for full repository access) - Generate and copy the token
- Set it as
GITHUB_TOKENenvironment variable
.
├── Dockerfile # Container image definition
├── docker-entrypoint.sh # Startup script for git setup
├── start-container.sh # Docker run command template
├── config/ # Persistent data (workspace, settings)
│ └── workspace/ # Your code repository
└── README.md # This file
If you encounter permission issues with git operations:
# Stop the container
docker stop code-server
# Fix workspace permissions
sudo chown -R 1000:1000 ./config/workspace
# Restart the container
docker start code-serverEnsure your GitHub token has the correct permissions:
- Token must have
reposcope - Token must be valid (not expired)
- Repository must exist and be accessible to your account
Check that:
GITHUB_TOKENis set correctlyGITHUB_REPOSITORYformat isusername/repo/config/workspacedirectory is empty- Network connectivity to GitHub is available
A docker-compose.yml file is provided. Edit it with your GitHub credentials, then run:
docker-compose up -dOr with Docker Compose:
docker compose up -d- VS Code - Latest code-server
- Node.js - Version 20.x via NodeSource
- Python - Python 3 with pip
- Rust - Latest stable toolchain via rustup
- Git - Pre-installed and configured
- OpenCode CLI - Additional development tools
This project builds upon linuxserver/code-server and VS Code.
For issues related to:
- Code Server: https://github.com/linuxserver/docker-code-server
- VS Code: https://github.com/microsoft/vscode
- This Project: Open an issue in the repository