## Summary Refactored the Dockerfile from a monolithic single-stage build into a lean multi-stage architecture with two distinct variants optimized for different use cases. ## Changes - **Multi-stage architecture**: Introduced three stages (`base`, `ci`, `coder`) - `base`: Internal foundation with Ubuntu 24.04, essential utilities, and timezone configuration - `ci`: Lightweight variant with Node.js LTS for CI/CD pipelines - `coder`: Full development environment with NVM, non-root user, and custom shell configuration - **Removed bloat**: Stripped out 20+ programming languages, build tools, and services not needed for base functionality - Removed: Python dev tools, Java/Go/Rust/Ruby/PHP/Perl, Bazel, Docker/K8s tools, browsers, Terraform, etc. - Kept: Core utilities, network tools, compression tools, git, and development essentials - **User-focused coder variant**: - Non-root `coder` user with passwordless sudo - NVM installation with configurable Node.js version (default: 24) - Custom bash prompt and environment setup - Global gitignore from toptal.com - Perfect for VS Code Remote Containers, Coder.com, and GitHub Codespaces - **Build arguments**: Added configurable parameters for the coder variant - `ARG_TZ`: Timezone configuration (default: Europe/Paris) - `ARG_NODE_MAJOR`: Node.js major version for NVM (default: 24) - `GITIGNORE_URL`: Custom gitignore template URL - **Updated documentation**: Completely rewrote README.md to reflect the new architecture - Clear explanation of each variant and its use case - Updated all examples to use proper image tags (`ci-latest`, `coder-latest`) - Added CI/CD workflow documentation with KANIKO_TARGET matrix ## Impact - **Smaller images**: Each variant only contains what it needs - **Faster builds**: Multi-stage caching improves build times - **Better DX**: Coder variant provides a ready-to-use development environment - **Flexible**: Easy to extend either variant for specific needs ## Breaking Changes - Image tags now use prefixes: `ci-*` and `coder-*` instead of a single `latest` tag - Removed all programming languages except Node.js from base images - Changed from root user to `coder` user in the coder variant ## Testing - [x] CI variant builds successfully - [x] Coder variant builds successfully - [x] Node.js is functional in both variants - [x] NVM works correctly in coder variant Reviewed-on: #2 |
||
|---|---|---|
| .forgejo/workflows | ||
| asset | ||
| CODE_OF_CONDUCT.md | ||
| CONTRIBUTING.md | ||
| Dockerfile | ||
| LICENSE | ||
| README.md | ||
Sindri
A flexible, multi-stage Docker image providing minimal to complete development environments. Choose the variant that fits your needs: from a lightweight base image to a full-featured development workspace.
Image Variants
Sindri provides two image variants built from a common base:
🔹 ci-* - CI/CD Ready
Lightweight image with Node.js LTS for continuous integration pipelines.
Features:
- Ubuntu 24.04 base with essential system utilities
- Core utilities (curl, wget, git, jq, nano, etc.)
- Network tools (ssh, rsync, netcat, etc.)
- Compression tools (zip, tar, gzip, xz, brotli, etc.)
- Build essentials (make, autoconf, pkg-config, etc.)
- Node.js LTS (via NodeSource)
- npm, yarn, and corepack
- Timezone configured to Europe/Paris
- Working directory set to
/workspace
Use case: Ideal for GitHub Actions, Forgejo Actions, GitLab CI, or any CI/CD pipeline requiring Node.js.
Available as: git.van-hemmen.com/actions/sindri:ci-latest, git.van-hemmen.com/actions/sindri:ci-26.8.1
docker pull git.van-hemmen.com/actions/sindri:ci-latest
docker run -it git.van-hemmen.com/actions/sindri:ci-latest
🔹 coder-* - Full Development Environment
Complete dev workspace with user configuration and NVM.
Features:
- Everything from the base layer
- Non-root
coderuser with passwordless sudo - Customized bash prompt and environment
- NVM (Node Version Manager) with Node.js 24
- Global gitignore configured from toptal.com
- Ready for VS Code Remote Containers, Coder, or similar
Use case: Full-featured development environment for remote coding, devcontainers, or local development.
Available as: git.van-hemmen.com/actions/sindri:coder-latest, git.van-hemmen.com/actions/sindri:coder-26.8.1
docker pull git.van-hemmen.com/actions/sindri:coder-latest
docker run -it git.van-hemmen.com/actions/sindri:coder-latest
Usage
Quick Start
# Pull and run the CI variant (for CI/CD)
docker pull git.van-hemmen.com/actions/sindri:ci-latest
docker run -it git.van-hemmen.com/actions/sindri:ci-latest
# Pull and run the coder variant (for development)
docker pull git.van-hemmen.com/actions/sindri:coder-latest
docker run -it git.van-hemmen.com/actions/sindri:coder-latest
Building with Custom Arguments
The coder variant supports build arguments:
docker build --target coder \
--build-arg ARG_TZ="America/New_York" \
--build-arg ARG_NODE_MAJOR=22 \
--build-arg GITIGNORE_URL="https://www.toptal.com/developers/gitignore/api/macos,linux,windows,node" \
-t sindri:coder-custom .
Available arguments:
ARG_TZ: Timezone (default:Europe/Paris)ARG_NODE_MAJOR: Node.js major version for NVM (default:24)GITIGNORE_URL: URL for global gitignore template
Using with Forgejo/GitHub Actions
Use the CI variant in your workflow:
jobs:
build:
runs-on: ubuntu-latest
container: git.van-hemmen.com/actions/sindri:ci-latest
steps:
- uses: actions/checkout@v4
- run: npm install
- run: npm test
Using with VS Code Remote Containers
Create .devcontainer/devcontainer.json:
{
"name": "Sindri Development Environment",
"build": {
"dockerfile": "../Dockerfile",
"target": "coder"
},
"remoteUser": "coder",
"workspaceFolder": "/workspace"
}
Or reference the remote image:
{
"name": "Sindri Development Environment",
"image": "git.van-hemmen.com/actions/sindri:coder-latest",
"remoteUser": "coder",
"workspaceFolder": "/workspace"
}
Extending the Image
Build on top of any variant:
FROM git.van-hemmen.com/actions/sindri:ci-latest
# Add your custom tools
RUN apt-get update && apt-get install -y \
postgresql-client \
redis-tools \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /myapp
Building Locally
# Build CI variant
docker build --target ci -t git.van-hemmen.com/actions/sindri:ci-dev .
# Build coder variant
docker build --target coder -t git.van-hemmen.com/actions/sindri:coder-dev .
# Build coder variant with custom args
docker build --target coder \
--build-arg ARG_NODE_MAJOR=20 \
-t git.van-hemmen.com/actions/sindri:coder-node20 .
CI/CD Workflows
Forgejo Actions workflows automate multi-target builds:
- docker-dev.yaml: Builds all targets on branch commits
- docker-tag.yaml: Builds and publishes versioned releases on tags
The workflows use the KANIKO_TARGET variable to build each variant:
strategy:
matrix:
target: [ci, coder]
env:
KANIKO_TARGET: ${{ matrix.target }}
Choosing the Right Variant
| Use Case | Recommended Variant |
|---|---|
| CI/CD pipeline with Node.js | ci-* |
| GitHub/Forgejo Actions | ci-* |
| Custom base for your own image | ci-* |
| VS Code Remote Containers | coder-* |
| Coder.com workspace | coder-* |
| GitHub Codespaces | coder-* |
| Local Node.js development | coder-* |
Version Information
- Base OS: Ubuntu 24.04 LTS
- Node.js: LTS (ci variant) or configurable via NVM (coder variant)
- Default Timezone: Europe/Paris (configurable)
License
Apache License 2.0 - See LICENSE file for details.
Contributing
See CONTRIBUTING.md for guidelines on how to contribute to this project.
Code of Conduct
This project follows a Code of Conduct. Please read CODE_OF_CONDUCT.md before contributing.
