Prerequisites

Docker

You need Docker installed and running on your machine. Any version with BuildKit support (18.09+) works.

Build Your First Container

1

Pull migetpacks

Download the latest migetpacks image from Docker Hub:
docker pull miget/migetpacks:latest
2

Run a build

Point migetpacks at your application source code. It will auto-detect the language, version, and build configuration:
docker run --rm \
  -v /path/to/your/app:/workspace/source \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -e OUTPUT_IMAGE=my-app:local \
  miget/migetpacks:latest
Replace /path/to/your/app with the absolute path to your project directory.
When OUTPUT_IMAGE does not contain a registry prefix (e.g., my-app:local instead of registry.io/my-app:latest), the image stays on your local Docker daemon and is not pushed anywhere.
3

Test the built image

Run your newly built container:
docker run --rm -p 5000:5000 my-app:local
Open http://localhost:5000 in your browser to see your app running.

What Happened?

When you ran migetpacks, it performed four steps automatically:
1

Language Detection

Scanned your source code for language markers (package.json, Gemfile, go.mod, requirements.txt, etc.) and identified the runtime.
2

Version Detection

Read version files (.nvmrc, .ruby-version, .python-version, go.mod) and lock files to determine the exact runtime version.
3

Dockerfile Generation

Generated an optimized multi-stage Dockerfile with dependency layer caching, build commands, and a minimal runtime stage.
4

Build and Output

Used Docker-in-Docker with BuildKit to build the image and load it into your local Docker daemon.

Common Options

docker run --rm \
  -v /path/to/your/app:/workspace/source \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -e OUTPUT_IMAGE=my-app:local \
  -e LANGUAGE=ruby \
  miget/migetpacks:latest

Push to a Registry

To push the built image to a remote registry, use a fully-qualified image name and mount your Docker credentials:
docker run --rm \
  -v /path/to/your/app:/workspace/source \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v $HOME/.docker/config.json:/root/.docker/config.json:ro \
  -e OUTPUT_IMAGE=registry.io/myorg/my-app:latest \
  miget/migetpacks:latest

Next Steps