Sign inSign up

rudransh404/cups

By rudransh404

Updated over 1 year ago

Containerized CUPS stack with IPP, Ghostscript, and Poppler.

Image
Networking
Operating systems
0

320

rudransh404/cups repository overview

CUPS Printing Stack

Containerized CUPS printing stack with cups-filters, Ghostscript, and Poppler for full printing support.

Introduction

The cups Docker image provides a complete printing stack, including CUPS, cups-filters, Ghostscript, and Poppler (for PostScript and PDF interpretation). This image delivers everything needed for printing (except printer-specific drivers) in a containerized environment. It’s designed for:

  1. A printing stack for purely container-based systems (e.g., Ubuntu Core).
  2. Replacing a classic Linux system’s printing packages with a Dockerized solution (future Ubuntu Desktop candidate).

Prerequisites

  • cups-ipp-utils & cups-client: Install on the Docker host:
sudo apt-get update
sudo apt-get install cups-ipp-utils cups-client -y

Pulling the Image

To pull the image from Docker Hub, run:

sudo docker pull rudransh404/cups

Running the Container

Run the container:

sudo docker run -d \
    --name cups \
    --network host \
    -e CUPS_PORT=<CUPS_PORT> \
    -e CUPS_ADMIN=<CUPS_ADMIN> \
    -e CUPS_PASSWORD=<CUPS_PASSWORD> \
    -v /dev/bus/usb:/dev/bus/usb:ro \
    --device-cgroup-rule='c 189:* rmw' \
    rudransh404/cups:latest
Parameters:
  • CUPS_PORT (optional): Sets the CUPS port (default: 631).
  • CUPS_ADMIN & CUPS_PASSWORD (optional): Administrative credentials. If omitted, view generated credentials:
    sudo docker exec cups cat /etc/cups/cups-credentials
    
  • --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/cups-snap -b rudransh404
cd cups-snap
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:cups:latest
Run the Container
sudo docker run -d \
    --name cups \
    --network host \
    -e CUPS_PORT=<CUPS_PORT> \
    -e CUPS_ADMIN=<CUPS_ADMIN> \
    -e CUPS_PASSWORD=<CUPS_PASSWORD> \
    -v /dev/bus/usb:/dev/bus/usb:ro \
    --device-cgroup-rule='c 189:* rmw' \
    rudransh404/cups:latest

Usage

  1. Web Interface Setup Access the web UI at:
http://localhost:<port>/

Manage printers and jobs using the CUPS admin credentials.

  1. CUPS Commands:
Inside Container
sudo docker exec -u "${CUPS_ADMIN}" cups lpadmin -p <printer>
From Host
CUPS_SERVER=localhost:<CUPS_PORT> lpstat -W completed

Note: For administrative tasks, add -U <CUPS_ADMIN> to lpadmin.

Included Components

  • cups v2.4.11: Core printing system.
  • cups-filters v2.0.1: Filtering system for print processing.
  • ghostscript v10.05.0: PostScript/PDF rendering engine.
  • poppler: PDF interpreter.
  • libcupsfilters v2.1.1: Print job filtering library.

How It Works

  • Print Processing: Ghostscript and Poppler render PostScript/PDF, with cups-filters handling job processing.
  • Printer Discovery: CUPS backends detect USB and network printers via IPP, LPD, and socket protocols.
  • IPP Support: Full compatibility with IPP clients for seamless printing.

Summary

The cups Docker image provides a complete printing stack with CUPS, cups-filters, Ghostscript, and Poppler, supporting PostScript and PDF rendering for a wide range of printers. It offers flexible deployment for containerized systems, classic Linux replacements, or as a secure printing proxy, with robust IPP support and network discovery.

Tag summary

Content type

Image

Digest

sha256:de74ab5f9

Size

139.6 MB

Last updated

over 1 year ago

docker pull rudransh404/cups