Pull the Docker image and scan your first barcode label
QR Code AI publishes the open-source Barcode Scanner container image on the GitHub Container Registry (GHCR) and lists it on Artifact Hub as a verified publisher. The CLI container packages qrscan for Linux AMD64 and ARM64, reading mounted label files and printing a JSON report completely offline. Where a backend prefers HTTP calls to one-shot CLI runs, a separate GHCR image provides a self-hosted HTTP scanning service.
Pull the image and decode the public sample
The first command downloads the public EAN-13 sample into your current folder. The Docker commands then pull the multi-platform GHCR CLI image and scan the mounted label offline.
curl -fsSL -o ean13.png \
https://raw.githubusercontent.com/qrcode-ai-com/qrcode-barcode-scanner-rust/main/fixtures/symbology/ean13.png
image=ghcr.io/qrcode-ai-com/qrcode-barcode-scanner:0.12.2
docker pull "$image"
docker run --rm --network none --read-only --cap-drop ALL \
--mount type=bind,src="$PWD",dst=/input,readonly "$image" /input/ean13.png --budget-ms 0 \
| jq '.detections[0] | {symbology, content, payload}'This command mounts your current directory read-only, drops all Linux capabilities and switches off network access. The jq filter extracts the first detection from the JSON report.
detections[0] refers to the first code listed in the report. When a label image also contains a QR code, the report lists that QR code first: filter by symbology instead, for example jq -r '.detections[] | select(.symbology == "ean13") | .content.text' for this EAN-13 sample.
qrscan offers three scan profiles: full (the default) calculates a scannability score for the first reported code at full depth, fast calculates it at reduced depth and frame decodes only.
This example requires jq, a command-line JSON processor. In a shell pipeline, the shell reports jq’s exit code rather than the scanner’s: to branch on the scanner’s exit code, write the report to a host file first (as shown under “Write the JSON report to the host”) and inspect the exit status, or run the pipeline with set -o pipefail.
These commands are written for a POSIX shell such as bash or zsh.
The same container image also decodes QR codes: see the QR Code Scanner Docker guide.
What the container returns
The container produces the same JSON report as the qrscan command-line program. For the public EAN-13 sample image downloaded above, the first detection reads:
{
"symbology": "ean13",
"content": {
"text": "9506000134352",
"raw": "OTUwNjAwMDEzNDM1Mg==",
"charset": "utf8"
},
"payload": {
"kind": "gs1",
"elements": [
{
"ai": "01",
"value": "09506000134352"
}
],
"gtin": "09506000134352",
"conformant": true,
"issues": []
}
}symbology gives the detected format, content.text gives the encoded digits verbatim and payload provides their parsed GS1 reading: Application Identifier 01 ("ai": "01") with the same number formatted as a 14-digit GTIN, leading zero included.
The scanner’s published example report contains the same detection.
Write the JSON report to the host
To decode your own label file, such as inventory-label.png, place it in the host folder you mount. Without a jq filter, qrscan outputs the complete scan report as JSON. Redirect standard output to a host file: the container itself writes nothing to disk.
docker run --rm --network none --read-only --cap-drop ALL \
--mount type=bind,src="$PWD",dst=/input,readonly \
ghcr.io/qrcode-ai-com/qrcode-barcode-scanner:0.12.2 /input/inventory-label.png --profile fast > report.jsonGiven inventory-label.png, a Code 128 label, the JSON report returns STOCK-4827 alongside its detected format.
To prepare a matching test label, create a test barcode with Barcode Generator using Code 128 and STOCK-4827, then save the PNG as inventory-label.png inside the mounted folder.
The distribution guide documents published release tags, image digests and provenance verification.
See the Barcode Scanner CLI guide for the full list of options.
