https://github.com/jonlabelle/docker-magika
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.
https://github.com/jonlabelle/docker-magika
ai docker google magika
Last synced: 7 days ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/jonlabelle/docker-magika
- Owner: jonlabelle
- License: mit
- Created: 2026-03-03T22:16:16.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-03-04T01:54:33.000Z (3 months ago)
- Last Synced: 2026-03-04T03:25:29.282Z (3 months ago)
- Topics: ai, docker, google, magika
- Language: Python
- Homepage: https://hub.docker.com/r/jonlabelle/magika
- Size: 23.4 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Docker Magika
[](https://github.com/jonlabelle/docker-magika/actions/workflows/cd.yml)
[](https://hub.docker.com/r/jonlabelle/magika)
[](https://hub.docker.com/r/jonlabelle/magika/tags)
> Docker image for [Magika](https://securityresearch.google/magika/introduction/overview), a novel AI-powered file type detection tool that relies on the recent advance of deep learning to provide accurate detection.
## Quick start
```bash
# 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-`
## Local development
```bash
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`](scripts/prune).