Skip to content

jonlabelle/docker-magika

Repository files navigation

Docker Magika

cd docker pulls image size

Docker image for Magika, a novel AI-powered file type detection tool that relies on the recent advance of deep learning to provide accurate detection.

Quick start

# Show Magika CLI help (default command)
docker run --rm jonlabelle/magika:latest

# Show version
docker run --rm jonlabelle/magika:latest --version

# Scan a file from the current directory
docker run --rm -v "$PWD:/workspace:ro" jonlabelle/magika:latest README.md

# Scan files matching a shell glob (expanded by your shell)
docker run --rm -v "$PWD:/workspace:ro" jonlabelle/magika:latest *.md

# Recursively scan all files in the current directory tree
docker run --rm -v "$PWD:/workspace:ro" jonlabelle/magika:latest --recursive .

Image details

  • Base image: python:slim
  • Entrypoint: compatibility wrapper (via entrypoint.sh) that prefers magika and falls back to magika-python-client when needed
  • Default command: --help
  • Runtime user: non-root (magika)
  • Working directory: /workspace (so mounted files can be referenced relatively)
  • Magika package: latest from PyPI (pip install magika)
  • Architectures: linux/amd64, linux/arm64
  • Note: On platforms without Rust CLI wheels, the wrapper automatically uses magika-python-client

Tags

  • latest
  • sha-<short-commit>

Local development

make lint
make build
make run ARGS="--version"
make run ARGS="README.md"

If docker is unavailable, the Makefile also supports podman and nerdctl.

Publishing

GitHub Actions (.github/workflows/cd.yml) builds and publishes multi-arch images to:

  • Docker Hub: jonlabelle/magika
  • GHCR: ghcr.io/jonlabelle/magika

The same workflow runs post-publish registry pruning via scripts/prune.

About

Docker image for Magika, a novel AI-powered file type detection tool that relies on the recent advance of deep learning to provide accurate detection.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors