Barcode Scanner with Docker

Decode barcode labels inside a versioned Docker container. Feed identifiers and detected formats straight into your automated jobs and pipelines.

  • GHCR

    One-shot CLI container

    View the pull command
  • HTTP Service

    Self-hosted HTTP service

    View the HTTP container

Barcode Scanner Docker at a glance

  • Published on GHCR and Artifact Hub

    CLI + HTTP

  • Multi-platform Linux builds

    AMD64 + ARM64

  • Decodes without network access

    Offline

  • Open-source licence

    MIT

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.

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

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

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

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

Published container images and catalogues for Barcode Scanner

Pull the MIT-licensed CLI or HTTP service image from GHCR, or check published release metadata on Artifact Hub.

GitHub Container Registry (CLI)

Pull ghcr.io/qrcode-ai-com/qrcode-barcode-scanner with no account needed on Linux AMD64 and ARM64. Pin a release tag or digest in batch jobs and check that user 65532 can read mounted label folders.

Artifact Hub

Review the verified-publisher catalogue entry on Artifact Hub to inspect available 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 label images over HTTP rather than running a one-shot CLI container.

How to run the Barcode Scanner Docker container

Pull the GHCR image, mount your local label folder read-only and capture the JSON report before passing values to another system.

  1. Step 1

    Pull the container image

    Pull ghcr.io/qrcode-ai-com/qrcode-barcode-scanner using an explicit release tag or SHA-256 digest. Docker automatically chooses the Linux AMD64 or ARM64 build.

  2. Step 2

    Mount your label directory

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

  3. Step 3

    Capture the report and exit cleanly

    Redirect the JSON output to a host file, pass --rm so Docker removes the stopped container and separate scanner exit codes (0, 1 or 2) from Docker start-up 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), without running a product lookup.

A Code 128 barcode image file passes through a Docker workflow to return the decoded value STOCK-4827.

Decode STOCK-4827 from inventory-label.png

Given inventory-label.png, the container returns STOCK-4827 (Code 128). Keep every character and any leading zeros intact for your stock or inventory database.

Run options, exit codes and supported barcode formats

Isolation and exit codes. Run the container with a read-only mount, all capabilities dropped and --network none; see the Docker run reference. Exit codes follow qrscan (0 for a detection, 1 for an empty scan and 2 for invalid input or an unreadable mount), and a null score under the frame profile never means zero.

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

Documentation and licence. Consult the distribution guide for current release tags and digests, and the scanner repository for source code and the MIT licence.

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

Use the Docker container for isolated jobs and reproducible Linux environments. For other tasks, pick the matching guide below.

Barcode Scanner

Decode a single barcode straight away, directly in your browser. No account needed and nothing to install.

Open the online barcode reader

Barcode Scanner CLI

Scan barcode label images from a shell script or CI pipeline using one local command.

Explore Barcode Scanner CLI

Barcode Scanner MCP Server

Let an AI assistant decode a barcode image via a structured tool call.

Explore Barcode Scanner MCP Server

Barcode Scanner Skills

Give an AI agent a repeatable procedure for checking barcode images.

Explore Barcode Scanner Skills

Barcode Scanner SDK

Embed local barcode decoding directly inside your own software, in your language.

Explore Barcode Scanner SDK

Barcode Scanner Docker questions

Image references, host mounts, CPU architectures, exit codes and licensing.

The barcode scanner Docker image packages a barcode-reading command and its runtime inside a self-contained container image. QR Code AI’s open-source image bundles the qrscan command: mount the folder holding your label files, and the container reads the target file and prints a JSON report containing each decoded value and format. It provides no hosted endpoint, browser interface or webcam stream, and it can access only the host files you mount.

Pull ghcr.io/qrcode-ai-com/qrcode-barcode-scanner using an explicit release tag from the GHCR package page, or pin its SHA-256 index digest for strict reproducibility. Record the image reference, target CPU architecture and container run options together in your pipeline configuration.

Mount the directory on your local machine that holds the barcode image and pass its path inside the container, for example /input/inventory-label.png. A read-only mount is all that is needed. Because the container runs as a non-root user (UID 65532), make sure the mounted file is readable by that user. Mounting a single folder keeps the rest of your host filesystem isolated.

The CLI Docker image (ghcr.io/qrcode-ai-com/qrcode-barcode-scanner) does not: it runs qrscan against a mounted label file and exits without opening a listening port. If your workflow needs a self-hosted HTTP barcode endpoint, pull the separate ghcr.io/qrcode-ai-com/qrcode-barcode-scanner-http container image from GHCR.

The published GHCR container image supports Linux AMD64 and ARM64. A single multi-platform manifest covers both architectures, so Docker automatically selects the variant that matches your host.

Inspect both the exit code and the scan report. Exit 1 signals a valid empty scan with no detections, whereas exit 0 means at least one code was decoded. Exit 2 reports invalid input or usage, such as a missing mount or an unreadable file. Container runtime failures occur before qrscan starts and return Docker’s own exit codes, 125 to 127: 125 when docker run itself fails, 126 when the command inside the container cannot be invoked and 127 when it cannot be found.

The container writes the same JSON scan report as the qrscan command-line program: each detection includes its value as text and its detected format. A Code 128 stock label containing STOCK-4827 returns STOCK-4827 with the format Code 128, while the public EAN-13 sample returns 9506000134352 together with the 14-digit GTIN 09506000134352 in its parsed GS1 payload. The value is an identifier rather than a product record: preserve every character, including leading zeros, and look it up in the system that assigned it.

No. A retail number or internal stock reference serves only as a lookup key for another system. Decoding it does not prove an assigned GS1 identifier, fetch a product name or current price, verify authenticity or certify printed-label quality. The JSON report gives the decoded value, its format and any parsed payload such as a 14-digit GTIN; it does not tell you who owns the number, what product it identifies or whether a physical label passes print verification.

No. Containerised scanning of existing barcode images uses no generation credits and starts no trial: it is completely separate from the QR Code AI creation platform and its generation API. That creation service has free creation limits and a seven-day Premium trial triggered by creating the first dynamic QR code or Smart Link; Premium is required to continue using the affected features afterwards. Scanning an image never alters what is encoded in a barcode. The scanner container image is open source under the MIT licence.