Sign inSign up

rudransh404/hplip-printer-app

By rudransh404

•Updated over 1 year ago

Containerized HPLIP Printer App for HP/Apollo printers with IPP support, and USB/network discovery.

Image
Networking
Operating systems
0

2.1K

rudransh404/hplip-printer-app repository overview

⁠hplip-printer-app

The hplip-printer-app Docker image provides a containerized solution for HP and Apollo printers using HP's HPLIP driver suite. It leverages PAPPL and cups-filters 2.x to create a modern Printer Application that bridges classic CUPS drivers with contemporary containerized environments while supporting USB and network printers.

⁠Features

  • HPLIP Driver Integration: Utilizes hpcups printer driver and HPLIP PPDs for high-quality printing, including photo printing.
  • HP Backend Discovery: Discovers USB printers via hp CUPS backend and network printers via hp-probe utility.
  • Protocol Support: Uses IEEE-1284.4 packet protocol for simultaneous printing/scanning (where supported).
  • IPP Attribute Mapping: Automatically maps standard IPP attributes to printer-specific options for seamless client compatibility.
  • Plugin Support: Enables download of proprietary HPLIP plugins for laser printers via web interface.
  • Multi-Protocol Printing: Supports IPP, IPPS, LPD, and socket protocols via CUPS backends.
  • Raster Data Processing: Converts PDF/PostScript input to raster data using Ghostscript for non-PostScript printers.
  • Debian-Patched HPLIP: Uses Debian's patched HPLIP source for improved reliability.

⁠Pulling the Image

To pull the image from Docker Hub, run:

sudo docker pull rudransh404/hplip-printer-app

⁠Running the Container

Create a persistent Docker volume:

sudo docker volume create hplip-printer-app

Run the container:

sudo docker run -d \
    --name hplip-printer-app \
    --network host \
    -e PORT=<port> \
    -v hplip-printer-app:/var/lib/hplip-printer-app \
    -v /dev/bus/usb:/dev/bus/usb:ro \
    --device-cgroup-rule='c 189:* rmw' \
    rudransh404/hplip-printer-app:latest
⁠Parameters:
  • PORT (optional): Specifies the port for the printer app. Defaults to 8000 (or increments if unavailable).
  • --network host: Required for discovering network printers.
  • -v /dev/bus/usb:/dev/bus/usb:ro: Grants read-only access to USB devices.
  • --device-cgroup-rule='c 189:* rmw': Ensures USB access permissions.

⁠Setting Up Locally

To build and run locally:

git clone https://github.com/rudra-iitm/hplip-printer-app -b rudransh404
cd hplip-printer-app
⁠Prerequisites

Install Rockcraft:

sudo snap install rockcraft --classic
⁠Build the Rock Image
rockcraft pack -v
⁠Convert to Docker Image
sudo rockcraft.skopeo --insecure-policy copy oci-archive:<rock_image> docker-daemon:hplip-printer-app:latest
⁠Run the Container
sudo docker run -d \
    --name hplip-printer-app \
    --network host \
    -e PORT=<port> \
    -v hplip-printer-app:/var/lib/hplip-printer-app \
    -v /dev/bus/usb:/dev/bus/usb:ro \
    --device-cgroup-rule='c 189:* rmw' \
    hplip-printer-app:latest

⁠Web Interface Setup

Access the web UI at:

http://localhost:<port>/

From the interface, you can:

  • Add a printer.
  • Select the discovered printer.
  • Configure settings (driver selection, media options, etc.).

⁠Included Components

  • pappl v1.4.8 – Printer application framework.
  • ghostscript v10.05.0 – PostScript/PDF interpreter.
  • cups v2.4.11 – Common UNIX Printing System.
  • cups-filters v2.0.1 – Filtering system for non-PostScript printers.
  • libcupsfilters 2.1.1 – CUPS filtering support library.
  • libppd 2.1.0 – PPD handling library.
  • pyppd 1.1.0 – PPD compression.
  • hplip 3.22.10 – HP Linux Imaging and Printing drivers.

⁠How It Works

⁠Key Functionality
  • Uses hp backend for advanced USB printer communication
  • Automatic IPP-to-PPD option mapping for color/quality settings
  • Supports both PostScript (hpps filter) and raster printers
  • Persistent configuration via Docker volumes
  • SNMP backend configuration for network discovery
  • Fallback to standard CUPS backends if HP discovery fails
⁠Printer Discovery and Management
  • Discovery: Combines HP-specific probes with standard CUPS backends
  • Manual Addition: Supports custom IP/hostname entries for network printers
  • Accessory Detection: Polls PostScript printers for tray/ink status
  • Quirk Workarounds: Editable USB quirks for problematic devices

⁠Summary

This Dockerized HPLIP Printer Application provides enterprise-grade support for HP/Apollo printers in a containerized environment. It combines HPLIP's hardware integration with modern IPP standards and container benefits, offering simplified deployment, persistent configuration, and cross-platform compatibility. Ideal for maintaining legacy printer support while transitioning to cloud-native infrastructure.

Tag summary

Content type

Image

Digest

sha256:6a3794ed9…

Size

135.5 MB

Last updated

over 1 year ago

docker pull rudransh404/hplip-printer-app