/cups-avahi-airprint

Docker image for CUPS intended as an AirPrint relay

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

mauricelumiere/cups-avahi-airprint

This Alpine-based Docker image runs a CUPS instance that is meant as an AirPrint relay for printers that are already on the network but not AirPrint capable. The other images out there never seemed to work right. I forked the original to use Alpine instead of Ubuntu and work on more host OS's.

Configuration

Volumes:

  • /config: where the persistent printer configs will be stored
  • /services: where the Avahi service files will be generated

Variables:

  • CUPSADMIN: the CUPS admin user you want created
  • CUPSPASSWORD: the password for the CUPS admin user

Ports/Network:

  • Must be run on host network. This is required to support multicasting which is needed for Airprint.

Example run command:

docker run --name cups --restart unless-stopped  --net host\
  -v /etc/avahi/services:/services \
  -v /etc/cups/config:/config \
  -e CUPSADMIN="admin" \
  -e CUPSPASSWORD="-Cups31-" \
  mauricelumiere/cups-avahi-airprint:latest

Build command:

docker build --rm --no-cache -t mauricelumiere/cups-avahi-airprint .

Add and set up printer:

  • CUPS will be configurable at http://[host ip]:631 using the CUPSADMIN/CUPSPASSWORD.
  • Make sure you select Share This Printer when configuring the printer in CUPS.
  • After configuring your printer, you need to close the web browser for at least 60 seconds. CUPS will not write the config files until it detects the connection is closed for as long as a minute.