Builder Options

Overview

CloudStation provides several builder options to containerize your applications. Each builder offers different approaches to creating container images, allowing you to choose the most suitable option for your project.

Available Builders

Docker

  • Description: Uses a Dockerfile to build the application
  • Best for: Custom build configurations and specific container requirements
  • Usage: Select when you have a Dockerfile defining your build process

Configuration

  • Requires a valid Dockerfile in your project
  • Dockerfile should be in the specified Root Directory
  • Supports multi-stage builds

Example Dockerfile

FROM node:14
WORKDIR /app
COPY . .
RUN npm install
CMD ["npm", "start"]

Nixpacks

  • Description: Automatically detects and builds based on source code
  • Best for: Projects without Dockerfiles that need automated builds
  • Usage: Select for automatic build environment detection

Features

  • Auto-detects programming languages
  • Handles dependency installation
  • Configures build environments automatically
  • Supports multiple frameworks

Supported Languages

  • Node.js (package.json)
  • Python (requirements.txt)
  • Ruby (Gemfile)
  • And many more

Pack

  • Description: Uses Cloud Native Buildpacks for container images
  • Best for: Standardized build processes across different platforms
  • Usage: Select when you want a higher-level abstraction over Dockerfiles

Configuration

pack build myapp --builder paketobuildpacks/builder:base

Provider Options

Heroku
  • Description: Uses Heroku Buildpacks
  • Best for: Heroku-compatible applications
  • Features:
    • Multi-language support
    • Optimized for Heroku platform
    • Extensive framework support
Paketo
  • Description: Uses Paketo Buildpacks
  • Best for: Open-source environments
  • Features:
    • Modular buildpack design
    • Enterprise-ready builds
    • Extensive language support
Google Cloud Platform
  • Description: Uses Google Cloud Buildpacks
  • Best for: Google Cloud deployments
  • Features:
    • GCP service optimization
    • Cloud-native compatibility
    • Enhanced security features

Choosing a Builder

Consider these factors when selecting a builder:

  1. Project Structure

    • Existing Dockerfile: Use Docker builder
    • No Dockerfile: Consider Nixpacks or Pack
  2. Build Requirements

    • Custom build steps: Docker
    • Automated detection: Nixpacks
    • Standard process: Pack
  3. Deployment Target

    • Google Cloud: GCP buildpacks
    • Heroku compatibility: Heroku buildpacks
    • Platform-agnostic: Paketo buildpacks

Best Practices

  1. Docker Builder

    • Optimize Dockerfile for layer caching
    • Use multi-stage builds for smaller images
    • Include only necessary files
  2. Nixpacks

    • Maintain clear project structure
    • Include appropriate config files
    • Document dependencies properly
  3. Pack

    • Choose appropriate builder for your stack
    • Configure buildpack-specific options
    • Test builds locally before deployment

Edit this file on GitHub