{"id":50148538,"url":"https://github.com/faisalthaheem/open-lpr","last_synced_at":"2026-05-24T07:01:34.520Z","repository":{"id":37917741,"uuid":"186710116","full_name":"faisalthaheem/open-lpr","owner":"faisalthaheem","description":"Open Source and Free License Plate Recognition Software","archived":false,"fork":false,"pushed_at":"2026-05-15T05:31:20.000Z","size":4984,"stargazers_count":224,"open_issues_count":0,"forks_count":33,"subscribers_count":9,"default_branch":"main","last_synced_at":"2026-05-15T06:47:56.702Z","etag":null,"topics":["alpr","convolutional-neural-networks","deep-learning","deep-neural-networks","license-plate-detection","license-plate-recognition","lpr","nodejs","nodered","open-source"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/faisalthaheem.png","metadata":{"files":{"readme":"README-BUILD-SCRIPT.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2019-05-14T22:34:38.000Z","updated_at":"2026-05-15T05:30:22.000Z","dependencies_parsed_at":"2022-07-11T23:31:09.145Z","dependency_job_id":null,"html_url":"https://github.com/faisalthaheem/open-lpr","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/faisalthaheem/open-lpr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faisalthaheem%2Fopen-lpr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faisalthaheem%2Fopen-lpr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faisalthaheem%2Fopen-lpr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faisalthaheem%2Fopen-lpr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/faisalthaheem","download_url":"https://codeload.github.com/faisalthaheem/open-lpr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faisalthaheem%2Fopen-lpr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33424573,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T22:14:44.296Z","status":"online","status_checked_at":"2026-05-24T02:00:06.296Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alpr","convolutional-neural-networks","deep-learning","deep-neural-networks","license-plate-detection","license-plate-recognition","lpr","nodejs","nodered","open-source"],"created_at":"2026-05-24T07:01:33.908Z","updated_at":"2026-05-24T07:01:34.512Z","avatar_url":"https://github.com/faisalthaheem.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Open LPR Docker Build Script\n\nThis document provides instructions for using the `build-docker-image.sh` utility script to build Docker images for the Open LPR application.\n\n## Overview\n\nThe `build-docker-image.sh` script is a comprehensive utility that automates the Docker image build process for the Open LPR (License Plate Recognition) application. It's based on the GitHub Actions workflow at `.github/workflows/docker-publish.yml` and provides similar functionality for local development and CI/CD pipelines.\n\n## Features\n\n- **Multi-platform builds**: Supports `linux/amd64` and `linux/arm64` by default\n- **Flexible tagging**: Custom image tags and registry configuration\n- **Build caching**: Optional GitHub Actions cache integration\n- **SBOM generation**: Optional Software Bill of Materials generation\n- **Container testing**: Basic container startup validation\n- **Metadata labeling**: Automatic OpenContainers metadata injection\n- **Verbose output**: Detailed build logging option\n\n## Prerequisites\n\n- Docker Engine with Buildx support\n- Bash shell\n- Git (for metadata extraction)\n\n### Optional Dependencies\n\n- `syft` - for SBOM generation (install with: `curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin`)\n- `jq` - for manifest inspection\n\n## Usage\n\n### Basic Usage\n\n```bash\n# Build local image with latest tag\n./build-docker-image.sh\n\n# Show help\n./build-docker-image.sh --help\n```\n\n### Advanced Usage\n\n```bash\n# Build with custom tag\n./build-docker-image.sh --tag v1.2.3\n\n# Build and push to registry\n./build-docker-image.sh --tag v1.2.3 --push\n\n# Build for specific platform only\n./build-docker-image.sh --platforms linux/amd64\n\n# Build without cache\n./build-docker-image.sh --no-cache\n\n# Generate SBOM\n./build-docker-image.sh --sbom\n\n# Verbose output\n./build-docker-image.sh --verbose\n\n# Custom registry and owner\n./build-docker-image.sh --registry docker.io --owner myusername --tag myapp\n```\n\n## Command Line Options\n\n| Option | Short | Description | Default |\n|--------|--------|-------------|-----------|\n| `--tag` | `-t` | Docker image tag | `latest` |\n| `--name` | `-n` | Image name | `open-lpr` |\n| `--registry` | `-r` | Container registry | `ghcr.io` |\n| `--owner` | `-o` | Repository owner | `faisalthaheem` |\n| `--push` | `-p` | Push image to registry after build | `false` |\n| `--no-cache` | `-c` | Disable build cache | `false` |\n| `--platforms` | | Target platforms | `linux/amd64,linux/arm64` |\n| `--sbom` | | Generate SBOM after build | `false` |\n| `--build-cache` | | Use build cache | `true` |\n| `--verbose` | `-v` | Verbose output | `false` |\n| `--help` | `-h` | Show help message | - |\n\n## Default Configuration\n\nThe script uses the following default values:\n\n- **Image Name**: `open-lpr`\n- **Registry**: `ghcr.io`\n- **Owner**: `faisalthaheem`\n- **Tag**: `latest`\n- **Platforms**: `linux/amd64,linux/arm64`\n- **Full Image Name**: `ghcr.io/faisalthaheem/open-lpr:latest`\n\n## Build Process\n\nThe script performs the following steps:\n\n1. **Validation**: Checks Docker and Buildx installation\n2. **Builder Setup**: Creates/uses a dedicated Buildx builder\n3. **Metadata Extraction**: Extracts Git commit, branch, and build date\n4. **Image Build**: Builds the Docker image with proper labels and cache\n5. **SBOM Generation** (optional): Creates Software Bill of Materials\n6. **Image Information**: Displays size and digest information\n7. **Container Testing**: Validates container startup\n8. **Push** (optional): Pushes to registry if requested\n\n## Generated Labels\n\nThe script automatically adds OpenContainers labels to the image:\n\n- `org.opencontainers.image.title` - Image title\n- `org.opencontainers.image.description` - Image description\n- `org.opencontainers.image.url` - Repository URL\n- `org.opencontainers.image.source` - Source code URL\n- `org.opencontainers.image.version` - Image version/tag\n- `org.opencontainers.image.created` - Build timestamp\n- `org.opencontainers.image.revision` - Git commit hash\n- `org.opencontainers.image.branch` - Git branch\n- `org.opencontainers.image.licenses` - License information\n\n## Output Examples\n\n### Successful Build\n\n```bash\n[INFO] Open LPR Docker Build Script\n[INFO] ============================\n[INFO] Configuration:\n[INFO]   Image Name: open-lpr\n[INFO]   Tag: latest\n[INFO]   Full Name: ghcr.io/faisalthaheem/open-lpr:latest\n[INFO]   Registry: ghcr.io\n[INFO]   Owner: faisalthaheem\n[INFO]   Platforms: linux/amd64\n[INFO]   Push: false\n[INFO]   Build Cache: true\n[INFO]   Generate SBOM: false\n\n[INFO] Starting Docker image build for Open LPR application...\n...\n[SUCCESS] Docker image built successfully: ghcr.io/faisalthaheem/open-lpr:latest\n[INFO] Image information:\nghcr.io/faisalthaheem/open-lpr:latest                                                                   652MB     2025-12-13 20:52:53 -0800 PST\n[INFO] Image digest: sha256:ecbed71813767d3ada5bc2b0e2749a87631d9e137551d65faa4bc213f9ae89d4\n[INFO] Running basic container tests...\n[SUCCESS] Container startup test passed\n[SUCCESS] Build process completed successfully!\n```\n\n## Integration with CI/CD\n\nThe script is designed to work seamlessly in CI/CD environments:\n\n### GitHub Actions\n\n```yaml\n- name: Build Docker image\n  run: |\n    chmod +x build-docker-image.sh\n    ./build-docker-image.sh --tag ${{ github.sha }} --push\n```\n\n### GitLab CI\n\n```yaml\nbuild_image:\n  script:\n    - chmod +x build-docker-image.sh\n    - ./build-docker-image.sh --tag $CI_COMMIT_SHA --push\n```\n\n## Troubleshooting\n\n### Common Issues\n\n1. **Docker Buildx not available**\n   ```bash\n   # Install Buildx\n   docker buildx install\n   ```\n\n2. **Permission denied**\n   ```bash\n   # Make script executable\n   chmod +x build-docker-image.sh\n   ```\n\n3. **Registry login required**\n   ```bash\n   # Login to registry\n   docker login ghcr.io\n   ```\n\n4. **Build context too large**\n   - Check `.dockerignore` file\n   - Exclude unnecessary files and directories\n\n### Debug Mode\n\nEnable verbose output for detailed debugging:\n\n```bash\n./build-docker-image.sh --verbose\n```\n\n## Comparison with GitHub Actions\n\nThis script replicates the functionality of `.github/workflows/docker-publish.yml`:\n\n| GitHub Actions | Script Equivalent |\n|---------------|-------------------|\n| `docker/setup-buildx-action@v3` | Built-in Buildx setup |\n| `docker/login-action@v3` | `docker login` |\n| `docker/metadata-action@v5` | Built-in metadata extraction |\n| `docker/build-push-action@v5` | `docker buildx build` |\n| `anchore/sbom-action@v0.17.2` | Optional `syft` integration |\n\n## Contributing\n\nWhen modifying the script:\n\n1. Maintain compatibility with existing options\n2. Update help text for new features\n3. Test with multiple platforms\n4. Validate container startup functionality\n5. Update this documentation\n\n## License\n\nThis script follows the same license as the Open LPR project (MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaisalthaheem%2Fopen-lpr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffaisalthaheem%2Fopen-lpr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaisalthaheem%2Fopen-lpr/lists"}