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.
# 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 .
- Base image:
python:slim - Entrypoint: compatibility wrapper (via
entrypoint.sh) that prefersmagikaand falls back tomagika-python-clientwhen 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
latestsha-<short-commit>
make lint make build make run ARGS="--version" make run ARGS="README.md"
If docker is unavailable, the Makefile also supports podman and nerdctl.
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.