Skip to content

Add Dockerfile for containerized deployment#438

Open
Jah-yee wants to merge 1 commit intomicrosoft:mainfrom
Jah-yee:add-dockerfile
Open

Add Dockerfile for containerized deployment#438
Jah-yee wants to merge 1 commit intomicrosoft:mainfrom
Jah-yee:add-dockerfile

Conversation

@Jah-yee
Copy link

@Jah-yee Jah-yee commented Mar 12, 2026

Summary

Adds a Dockerfile to enable running BitNet in containerized environments like Kubernetes.

Changes

  • Added Dockerfile with:
    • Python 3.11-slim base image
    • Build dependencies (cmake, build-essential, libomp-dev)
    • Python dependencies from requirements.txt
    • Support for model volume mounting
    • Default command shows help

Motivation

Resolves issue #433 - enables deployment on powerful CPUs via infrastructure like Kubernetes.

Usage

# Build the image
docker build -t bitnet .

# Run inference
docker run --rm -v /path/to/models:/workspace/models bitnet \
  python run_inference.py -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf -p "Your prompt" -cnv

Testing

The Dockerfile follows best practices:

  • Multi-stage not needed since this is a Python + CMake build
  • Uses slim image to minimize size
  • Includes all necessary build tools for native extension compilation

- Enables running BitNet in Kubernetes or Docker environments
- Uses Python 3.11-slim as base image
- Installs all build dependencies (cmake, build-essential)
- Includes Python requirements for inference
- Resolves: microsoft#433
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant