Barcode Scanner with Docker

Decode barcode label images inside a versioned container and feed exact identifiers and formats into your pipelines.

  • GHCR

    CLI container image

    View pull command

Barcode Scanner Docker at a glance

  • Published on GHCR and Artifact Hub

    CLI + HTTP

  • Linux architectures

    AMD64 + ARM64

  • Runs without network access

    Offline

  • Open-source licence

    MIT

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.

Shell
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:

JSON
{
  "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.

Shell
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.json

For 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.

Published container images and catalogues for Barcode Scanner

Pull the MIT-licensed CLI or HTTP service container from GHCR, or verify release metadata on Artifact Hub.

GitHub Container Registry (CLI)

Pull ghcr.io/qrcode-ai-com/qrcode-barcode-scanner without an account for Linux AMD64 and ARM64. Pin a release tag or digest in batch jobs and ensure user 65532 can read mounted label folders.

Artifact Hub

Check the verified-publisher catalogue listing on Artifact Hub to review container tags, package metadata and security checks before pulling from GHCR.

HTTP Service Container (GHCR)

Deploy ghcr.io/qrcode-ai-com/qrcode-barcode-scanner-http when a warehouse or backend service sends barcode images over HTTP instead of invoking a one-shot CLI container.

How to run the Barcode Scanner container

Pull the GHCR image, mount your label directory read-only and capture the JSON report before calling any downstream system.

  1. Step 1

    Pull the container image

    Pull ghcr.io/qrcode-ai-com/qrcode-barcode-scanner by release tag or SHA-256 digest. Docker selects Linux AMD64 or ARM64 automatically.

  2. Step 2

    Mount your label input

    Bind-mount the host folder read-only and pass /input/inventory-label.png. Verify non-root user 65532 has read access to the file.

  3. Step 3

    Capture output and clean up

    Save stdout JSON, pass --rm to remove the stopped container and separate scanner exit codes (0, 1, 2) from Docker errors (125 to 127).

What a decoded barcode returns: Code 128 and EAN-13 examples

The container outputs JSON detections carrying content.text and symbology (such as STOCK-4827 as Code 128 or 9506000134352 as EAN-13) with no product lookup.

A saved Code 128 barcode label passes through a Docker workflow and produces the decoded value STOCK-4827.

Decode STOCK-4827 from inventory-label.png

For inventory-label.png, the container returns STOCK-4827 (Code 128). Preserve every character and leading zero for your inventory database.

Run flags, exit codes and supported barcode formats

Isolation and exit codes. Run with a read-only mount, dropped capabilities and --network none; check the Docker container run reference. Exit codes match qrscan (0 decoded, 1 empty, 2 invalid input or mount), and a null frame score never means zero.

Formats and MCP alternative. One container decodes 16 barcode symbologies (Code 128, EAN/UPC, ITF, Data Matrix, PDF417, Aztec, MaxiCode; GS1-128 → code128, ITF-14 → itf, ISBN → ean13) plus QR. For AI tool calls, see the Barcode Scanner MCP Server guide.

Documentation and licence. Read the distribution and install guide for tags and digests, and the open-source scanner repository for source code and the MIT licence.

CLI, Docker, MCP server, skill or SDK: which barcode scanner fits?

The Docker image suits container jobs and reproducible CI runners. For another workflow, pick the matching guide below.

Barcode Scanner

Decode a single barcode right away in your browser with nothing to install.

Open barcode reader

Barcode Scanner CLI

Decode label images inside a shell script or CI pipeline with a single command.

Explore Barcode Scanner CLI

Barcode Scanner MCP Server

Let an AI assistant decode a label image locally through a structured tool call.

Explore Barcode Scanner MCP Server

Barcode Scanner Skills

Give an AI agent a repeatable local procedure for reading barcode images.

Explore Barcode Scanner Skills

Barcode Scanner SDK

Embed local barcode decoding directly inside your own application.

Explore scanner SDK

Barcode Scanner Docker questions

Image references, mounts, CPU architectures, errors and licensing.

The barcode scanner Docker image packages the barcode-reading binary together with its minimal runtime. QR Code AI’s open-source CLI image wraps qrscan: you mount the folder holding your label files, the container decodes the target image and outputs a JSON report listing each identifier and its format. It provides no hosted endpoint, browser UI or camera stream, and can access only the folder you mount.

Pull ghcr.io/qrcode-ai-com/qrcode-barcode-scanner with an explicit release tag from the GHCR package page, or pin its SHA-256 index digest for strict reproducibility. Keep the tag or digest, CPU architecture and run flags together in your job configuration.

Bind-mount the directory on your computer holding the barcode file and pass its container-side path, such as /input/inventory-label.png. A read-only mount is sufficient. Because the container runs as a non-root user, verify the file has read permissions; mounting one directory never exposes the rest of your host filesystem.

The CLI image (ghcr.io/qrcode-ai-com/qrcode-barcode-scanner) does not expose an HTTP endpoint: it runs qrscan on a mounted file and exits with no open port. If you need a self-hosted HTTP barcode service, pull the separate ghcr.io/qrcode-ai-com/qrcode-barcode-scanner-http image from GHCR.

The published GHCR image covers Linux AMD64 and ARM64 through a single multi-platform index, so Docker automatically selects the variant matching either architecture. Other CPU architectures are not built in this index.

Inspect both the exit code and stdout report. Exit 0 means a detection, exit 1 means a valid empty scan and exit 2 flags invalid input or usage such as a missing mount or unreadable file. Docker reports its own startup failures with exit codes 125 to 127 before qrscan executes: 125 when docker run fails, 126 when the command cannot be invoked and 127 when it cannot be found.

The container outputs the exact same JSON report as qrscan: each detected barcode with its text value and symbology. A Code 128 label storing STOCK-4827 returns STOCK-4827 as Code 128; the public EAN-13 sample returns 9506000134352 together with a parsed GS1 payload carrying the 14-digit GTIN 09506000134352. Keep every character including leading zeros and query your own database.

No. A retail number or internal code is purely a lookup key for another system. Decoding it does not prove an assigned GS1 registration, fetch a product title or price, verify authenticity or certify printed-label quality. The report returns the decoded string, its format and any parsed payload such as a 14-digit GTIN, not ownership or catalogue details.

No. Containerised barcode decoding uses zero generation credits and starts no trial: it is separate from QR Code AI’s creation platform and generation API. That service has free creation limits, a seven-day Premium trial triggered by the first dynamic QR code or Smart Link, and Premium requirements for continued use of affected features. Reading a barcode never alters what is encoded, and the scanner container is open source under the MIT licence.