Migetpacks
Zero-config container builds for 14 languages. Auto-detects Node.js, Python, Go, Ruby, Rust, Java, PHP, .NET, Elixir, Kotlin, Scala, Clojure, Deno, Bun. No Dockerfile required.
Install / Use
/learn @migetapp/MigetpacksREADME
migetpacks
Auto-detecting buildpacks for container images - automatically detects your language, version, and builds optimized container images using official upstream Docker images.
Built by miget.com - Unlimited apps, one price.
Features
- Zero Config - Automatically detects language, version, and builds your app
- 14 Languages - Node.js, Deno, Bun, Python, Ruby, Go, Rust, Java, Kotlin, Scala, Clojure, .NET, PHP, Elixir
- Secure by Default - Optional Docker Hardened Images (distroless, CVE-free)
- Multi-Buildpack - Combine languages (e.g., Ruby + Node.js for asset compilation)
- Procfile Support - Standard process definitions
- Non-root Runtime - All containers run as non-root user
- Fast Builds - BuildKit layer caching and registry-based caching
Requirements
- Docker Desktop (macOS/Windows) or Docker Engine (Linux)
- BuildKit enabled (default in Docker Desktop 4.0+)
migetpacks runs Docker-in-Docker using BuildKit for optimized multi-stage builds. It requires access to the Docker socket (/var/run/docker.sock).
# Verify Docker is running
docker info
# Verify BuildKit is available
docker buildx version
Quick Start
Docker
# Build your app
docker run --rm \
-v /path/to/your/app:/workspace/source \
-v /var/run/docker.sock:/var/run/docker.sock \
-e OUTPUT_IMAGE=my-app:latest \
miget/migetpacks:latest
# Run your app
docker run -p 5000:5000 my-app:latest
GitHub Actions (GitHub-hosted runners)
For ephemeral ubuntu-latest runners, use registry-based caching via CACHE_IMAGE:
name: Build and Push
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Required for CACHE_IMAGE support
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push with migetpacks
run: |
docker run --rm \
-v ${{ github.workspace }}:/workspace/source:ro \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /home/runner/.docker/config.json:/root/.docker/config.json:ro \
-e OUTPUT_IMAGE=ghcr.io/${{ github.repository }}:${{ github.sha }} \
-e CACHE_IMAGE=ghcr.io/${{ github.repository }}:cache \
miget/migetpacks:latest
GitHub Actions (Self-hosted runners)
For persistent self-hosted runners, use local file cache via BUILD_CACHE_DIR:
name: Build and Push
on:
push:
branches: [main]
jobs:
build:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Log in to registry
uses: docker/login-action@v3
with:
registry: registry.example.com
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push with migetpacks
run: |
docker run --rm \
-v ${{ github.workspace }}:/workspace/source:ro \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $HOME/.docker/config.json:/root/.docker/config.json:ro \
-v /var/cache/migetpacks:/cache \
-e OUTPUT_IMAGE=registry.example.com/my-app:${{ github.sha }} \
-e BUILD_CACHE_DIR=/cache \
miget/migetpacks:latest
Cache options:
CACHE_IMAGE- Registry-based BuildKit layer cache. Requiresdocker/setup-buildx-action. Works on ephemeral runners.BUILD_CACHE_DIR- Local directory for package manager caches (npm, pip, bundler, etc.). Best for persistent self-hosted runners.
Supported Languages
| Language | Detection | Version Source |
|----------|-----------|----------------|
| Node.js | package.json | .nvmrc, .node-version, package.json |
| Deno | deno.json, deno.jsonc | deno.json |
| Bun | bun.lockb, bunfig.toml | package.json |
| Python | requirements.txt, Pipfile, pyproject.toml | .python-version, runtime.txt |
| Ruby | Gemfile | .ruby-version, Gemfile |
| Go | go.mod | go.mod |
| Rust | Cargo.toml | Cargo.toml |
| PHP | composer.json, index.php | composer.json |
| Java | pom.xml, build.gradle | pom.xml, .java-version, system.properties |
| Kotlin | build.gradle.kts | system.properties |
| Scala | build.sbt | system.properties |
| Clojure | project.clj, deps.edn | system.properties |
| .NET | *.csproj, *.fsproj | global.json, *.csproj |
| Elixir | mix.exs | mix.exs, .elixir-version |
| Dockerfile | Dockerfile | - |
| Compose | compose.yaml, docker-compose.yml | - |
Environment Variables
| Variable | Required | Default | Description |
|----------|----------|---------|-------------|
| OUTPUT_IMAGE | Yes | - | Target image name (e.g., ghcr.io/user/app:tag) |
| SOURCE_DIR | No | /workspace/source | Source code directory |
| LANGUAGE | No | auto-detected | Force language (see values below) |
| RUN_COMMAND | No | from Procfile | Override the run command |
| PORT | No | 5000 | Application port |
| ARCH | No | x86_64 | Target architecture (x86_64, arm64) |
| PROJECT_PATH | No | - | Subdirectory for monorepo builds |
| BUILDPACKS | No | auto-detected | Explicit buildpack order (e.g., ruby,nodejs) |
| DOCKERFILE_PATH | No | - | Custom Dockerfile path (forces dockerfile language) |
| COMPOSE_FILE | No | - | Custom compose file path (forces compose language) |
| TAG_LATEST | No | false | Also tag image with :latest in addition to primary tag |
| RESULT_FILE | No | - | Path to write build results JSON |
| STORAGE_DRIVER | No | overlay2 | Docker storage driver (e.g., fuse-overlayfs for nested DinD) |
Caching Options
| Variable | Required | Default | Description |
|----------|----------|---------|-------------|
| CACHE_IMAGE | No | - | Registry image for BuildKit cache |
| CACHE_MODE | No | min | BuildKit cache export mode: min (final layer) or max (all layers) |
| CACHE_FROM | No | - | Additional read-only cache sources (comma-separated registry refs) |
| CACHE_REGISTRY_INSECURE | No | false | Set to true for HTTP registries |
| NO_CACHE | No | false | Force fresh build, skips cache-from |
| BUILD_CACHE_DIR | No | - | Directory for package manager cache |
| REGISTRY_MIRROR | No | - | Docker registry mirror URL |
Docker Hardened Images
| Variable | Required | Default | Description |
|----------|----------|---------|-------------|
| USE_DHI | No | false | Use Docker Hardened Images from dhi.io |
| DHI_USERNAME | No | - | DHI registry username (alternative to mounting docker config) |
| DHI_PASSWORD | No | - | DHI registry password/token |
| DHI_MIRROR | No | - | DHI registry mirror URL |
Custom Build Environment Variables
Any environment variable passed to migetpacks that is not a known configuration variable will be automatically injected into the generated Dockerfile as ENV statements. This allows you to pass custom build-time settings without modifying migetpacks.
# Pass NODE_OPTIONS to increase heap size for large builds
docker run --rm \
-v ./my-app:/workspace/source \
-v /var/run/docker.sock:/var/run/docker.sock \
-e OUTPUT_IMAGE=my-app:latest \
-e NODE_OPTIONS="--max-old-space-size=4096" \
miget/migetpacks:latest
# Pass multiple custom variables
docker run --rm \
-v ./my-app:/workspace/source \
-v /var/run/docker.sock:/var/run/docker.sock \
-e OUTPUT_IMAGE=my-app:latest \
-e NODE_OPTIONS="--max-old-space-size=4096" \
-e VITE_API_URL="https://api.example.com" \
-e MY_BUILD_FLAG="true" \
miget/migetpacks:latest
Common use cases:
NODE_OPTIONS="--max-old-space-size=4096"- Increase Node.js heap for large buildsVITE_*/NEXT_PUBLIC_*- Frontend build-time variablesRAILS_MASTER_KEY- Rails credentials key for asset precompilation- Custom feature flags for conditional compilation
Note: Sensitive variables like AWS_* credentials and Docker configuration are automatically filtered out and never injected into the Dockerfile.
LANGUAGE Values
Force a specific language by setting LANGUAGE:
| Value | Description |
|-------|-------------|
| nodejs | Node.js (npm, yarn, pnpm) |
| deno | Deno runtime |
| bun | Bun runtime |
| python | Python (pip, uv) |
| ruby | Ruby (bundler) |
| go | Go |
| rust | Rust (cargo) |
| php | PHP (FrankenPHP + Composer) |
| java | Java (Maven or Gradle) |
| kotlin | Kotlin (Gradle) |
| scala | Scala (sbt) |
| clojure | Clojure (Leiningen) |
| .net or dotnet | .NET / C# |
| elixir | Elixir (Mix) |
| dockerfile | Use project's Dockerfile directly |
| compose | Build all services from compose.yaml |
Procfile Support
Define processes in a Procfile:
web: bundle exec puma -C config/puma.rb
worker: bundle exec sidekiq
release: bundle exec rails db:migrate
Priority order:
RUN_COMMANDenvironment variableweb:process from Procfile- First process in Procfile
- Language-specific default
Multi-Buildpack
Build apps with multiple languages:
# Ruby app with Node.js for asset compilation
docker run --rm \
-v ./my-rails-app:/workspace/source \
-v /var/run/docker.sock:/var/run/docker.sock \
-e OUTPUT_IMAGE=my-rails-app:latest \
-e BUILDPACKS=ruby,nodejs \
miget/migetpacks:latest
