DEV Community

Alex Spinov
Alex Spinov

Posted on

Buildpacks Has a Free API: Build Container Images Without Writing a Dockerfile

Why Cloud Native Buildpacks

Buildpacks detect your app language, install dependencies, and produce an OCI image — no Dockerfile required. Used by Heroku, Google Cloud Run, and Railway.

Install Pack CLI

brew install buildpacks/tap/pack
Enter fullscreen mode Exit fullscreen mode

Build Any App

# Node.js app
pack build my-node-app --builder paketobuildpacks/builder-jammy-base

# Python app
pack build my-python-app --builder paketobuildpacks/builder-jammy-base

# Go app
pack build my-go-app --builder paketobuildpacks/builder-jammy-base

# Java app
pack build my-java-app --builder paketobuildpacks/builder-jammy-base
Enter fullscreen mode Exit fullscreen mode

Pack auto-detects the language and configures everything.

How It Works

  1. Detect — Which buildpacks apply? (Node? Python? Go?)
  2. Build — Install deps, compile, configure
  3. Export — Create OCI image with proper layers

Rebase (Update Base Image Without Rebuild)

# Update OS layer without rebuilding app
pack rebase my-node-app
Enter fullscreen mode Exit fullscreen mode

Security patches to the base image without rebuilding application code.

Spring Boot Integration

# Spring Boot has built-in buildpack support
./mvnw spring-boot:build-image
Enter fullscreen mode Exit fullscreen mode

CI/CD (GitHub Actions)

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: buildpacks/github-actions/setup-pack@v5
      - run: pack build ghcr.io/myorg/myapp:latest --builder paketobuildpacks/builder-jammy-base --publish
Enter fullscreen mode Exit fullscreen mode

Key Features

  • No Dockerfile — auto-detect language and build
  • Reproducible — same code = same image
  • Rebase — update OS without rebuild
  • Multi-language — Java, Node, Go, Python, Ruby, .NET, PHP
  • CNCF Incubating — industry standard
  • SBOM — automatic Software Bill of Materials

Resources


Need to extract container build data, image metadata, or CI/CD metrics? Check out my Apify tools or email spinov001@gmail.com for custom solutions.

Top comments (0)