Pull the container image and decode your first barcode label
QR Code AI publishes the open-source Barcode Scanner container image on GitHub Container Registry (GHCR) and lists it on Artifact Hub as a verified publisher. The CLI container packages qrscan for Linux AMD64 and ARM64: it decodes mounted label files and outputs a JSON report completely offline. A separate GHCR image provides a self-hosted HTTP service for backends that submit barcode images over HTTP.
Pull the container image and test the public sample
The first command downloads the public EAN-13 label into your current folder. The docker commands then pull the multi-platform GHCR CLI image and decode 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 run mounts the current directory read-only, drops all Linux capabilities and disables networking. The jq filter extracts the first detection from the JSON report.
detections[0] returns the first entry in the report. If a label image also includes a QR code, the report lists QR codes ahead of barcodes, so filter by format instead, for example jq -r '.detections[] | select(.symbology == "ean13") | .content.text' for this EAN-13 label.
qrscan supports three profiles: full (default) computes a full-depth scannability score for the first code, fast computes a lighter score and frame decodes only.
This snippet requires jq, a command-line JSON filter. Because a pipeline returns the exit code of jq rather than the scanner, write the JSON report to a file first (as shown under “Save the JSON report on the host”) before inspecting the exit code, or enable set -o pipefail.
Commands in this guide target a POSIX shell such as bash or zsh.
The same container image also decodes QR codes: check the QR Code Scanner Docker guide.
Expected output
The container prints the exact same JSON schema as the qrscan CLI. For the public EAN-13 sample label downloaded above, the first detection returns:
{
"symbology": "ean13",
"content": {
"text": "9506000134352",
"raw": "OTUwNjAwMDEzNDM1Mg==",
"charset": "utf8"
},
"payload": {
"kind": "gs1",
"elements": [
{
"ai": "01",
"value": "09506000134352"
}
],
"gtin": "09506000134352",
"conformant": true,
"issues": []
}
}symbology names the detected format, content.text preserves the digits exactly as encoded and payload gives their GS1 interpretation: Application Identifier 01 ("ai": "01") formatted as a 14-digit GTIN with its leading zero intact.
The scanner’s published EAN-13 example report shows this exact detection.
Save the JSON report on the host
To decode your own label file, shown here as inventory-label.png, place it in your mounted directory. Without a filter, qrscan writes the complete JSON report to stdout. Redirect it to a host file because the container writes nothing itself.
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.jsonFor inventory-label.png, a Code 128 label, the report returns STOCK-4827 alongside its format.
Need a test label? Create a test barcode with Barcode Generator using Code 128 and STOCK-4827, then save the PNG as inventory-label.png inside your mounted folder.
The distribution and install guide documents published tags, digests and provenance verification.
See the Barcode Scanner CLI guide for every supported option.
