Refactor Dockerfile to multi-stage build with CI and Coder variants #2

Merged
GuillaumeHemmen merged 2 commits from feat/make-sindri-a-simple-base-image into master 2026-02-19 16:13:58 +00:00

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

  • CI variant builds successfully
  • Coder variant builds successfully
  • Node.js is functional in both variants
  • NVM works correctly in coder variant
## 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
#0000 - Split workflows and update Dockerfile for targeted multi-stage builds
All checks were successful
/ docker-dev-coder (push) Successful in 3m0s
/ docker-dev-ci (push) Successful in 2m10s
55cc34e302
- **Workflows**: Separated `ci` and `coder` jobs in both `docker-dev.yaml` and `docker-tag.yaml` for better variant builds.
- **Dockerfile**: Introduced `base`, `ci`, and `coder` stages for clearer multi-stage build targeting.
- **README**: Updated to reflect new image variants and usage examples.
#0000 - Update README to reflect new Docker image variants and usage clarifications
All checks were successful
/ docker-dev-ci (push) Successful in 1m53s
/ docker-dev-coder (push) Successful in 2m58s
af1f3d5b2c
GuillaumeHemmen scheduled this pull request to auto merge when all checks succeed 2026-02-19 16:13:44 +00:00
GuillaumeHemmen deleted branch feat/make-sindri-a-simple-base-image 2026-02-19 16:13:58 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
actions/sindri!2
No description provided.