A production-ready Docker container that decodes QR codes from URLs with automatic fallback strategies for maximum reliability.
docker run --rm \
-e URL_TO_IMAGE=https://example.com/qrcode.png \
javierattorq/qr-decoder:latest
Output:
{
"output": {
"qr_detected": true,
"qr_strings": "https://decoded-content.com",
"version": "1.3.3",
"library": "pyzbar"
}
}
All responses return structured JSON:
{
"output": {
"qr_detected": boolean, // true if QR code was found
"qr_strings": string, // decoded content
"version": string, // container version
"library": string // decoder used (pyzbar/opencv/none)
}
}
docker run --rm \
-e URL_TO_IMAGE=https://suspicious-email.com/qr.png \
javierattorq/qr-decoder:latest
result=$(docker run --rm \
-e URL_TO_IMAGE="$image_url" \
javierattorq/qr-decoder:latest)
if echo "$result" | jq -e '.output.qr_detected' > /dev/null; then
decoded_url=$(echo "$result" | jq -r '.output.qr_strings')
echo "Decoded URL: $decoded_url"
fi
import subprocess
import json
result = subprocess.run(
["docker", "run", "--rm",
"-e", f"URL_TO_IMAGE={image_url}",
"javierattorq/qr-decoder:latest"],
capture_output=True,
text=True
)
data = json.loads(result.stdout)
if data['output']['qr_detected']:
print(f"Decoded: {data['output']['qr_strings']}")
print(f"Library: {data['output']['library']}")
# No URL provided
$ docker run --rm javierattorq/qr-decoder:latest
{
"output": {
"qr_detected": false,
"qr_strings": "URL_TO_IMAGE environment variable not set",
"version": "1.3.3",
"library": "none"
}
}
# No QR code found
$ docker run --rm -e URL_TO_IMAGE=https://example.com/plain-image.jpg javierattorq/qr-decoder:latest
{
"output": {
"qr_detected": false,
"qr_strings": "No QR code found",
"version": "1.3.3",
"library": "none"
}
}
| Variable | Required | Description | Example |
|---|---|---|---|
URL_TO_IMAGE | ✅ Yes | URL to image containing QR code | https://example.com/qr.png |
| Library | Success Rate | Speed | Best For |
|---|---|---|---|
| pyzbar | ★★★★★ 95% | Fast | Standard QR codes, complex patterns |
| OpenCV | ★★☆☆☆ 60% | Very Fast | Simple QR codes, fallback option |
| Tag | Description | Size |
|---|---|---|
latest | Latest stable version | ~500MB |
v1.3.3 | Current version with bash entrypoint | ~500MB |
v1.3.2 | Previous version | ~500MB |
Recommended: Always use latest or a specific version tag for production.
python:3.11-slim (Debian Bookworm)linux/amd64 (x86_64)linux/arm64 (ARM64/Apple Silicon)steps:
- name: Decode QR Code
image: javierattorq/qr-decoder:latest
environment:
URL_TO_IMAGE: "{{ incident.qr_code_url }}"
- name: Process URL
condition: "{{ steps.decode_qr.output.qr_detected }}"
script: |
url="${{ steps.decode_qr.output.qr_strings }}"
# Analyze decoded URL...
version: '3.8'
services:
qr-decoder:
image: javierattorq/qr-decoder:latest
environment:
- URL_TO_IMAGE=${QR_IMAGE_URL}
apiVersion: batch/v1
kind: Job
metadata:
name: qr-decode-job
spec:
template:
spec:
containers:
- name: qr-decoder
image: javierattorq/qr-decoder:latest
env:
- name: URL_TO_IMAGE
value: "https://example.com/qr.png"
restartPolicy: Never
Solution: Ensure URL_TO_IMAGE environment variable is set.
Causes:
Solution: Verify URL is publicly accessible and points to a valid image (PNG, JPG, etc.)
Causes:
Solution: Ensure image contains a clear, readable QR code.
Cause: Architecture mismatch
Solution: Specify platform explicitly:
docker run --platform linux/amd64 --rm -e URL_TO_IMAGE=<url> javierattorq/qr-decoder:latest
Contributions welcome! Please see our Contributing Guide.
MIT License - see LICENSE for details.
Built for Security Teams | Powered by Torq
Last Updated: February 2026 | Version: 1.3.3
Content type
Image
Digest
sha256:0b677173a…
Size
390.2 MB
Last updated
9 months ago
docker pull javierattorq/qr-decoder