Fork from quadportnick/docker-cups-airprint
Use the latest or version# tags to auto choose the right architecture.
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.
CUPS registers shared printers directly with Avahi via D-Bus for mDNS/DNS-SD advertisement. When you add a printer in CUPS and mark it as shared, it automatically becomes discoverable by iPhones, iPads, and Macs on your network -- no extra configuration needed.
- Native DNS-SD registration: CUPS now registers printers with Avahi directly over D-Bus, replacing the previous
airprint-generate.pyscript that manually created Avahi service files. This fixes an issue where iOS devices would show duplicate printer entries due to a mismatch between the mDNS service name and the CUPS IPP response. - Removed
/servicesvolume: No longer needed since Avahi service files are no longer generated externally.
/config: where the persistent printer configs will be stored
CUPSADMIN: the CUPS admin user you want created - default is CUPSADMIN if unspecifiedCUPSPASSWORD: the password for the CUPS admin user - default is the same value asCUPSADMINif unspecifiedAVAHI_HOSTNAME: the mDNS hostname Avahi will advertise - default iscups-airprint. Set this to a unique name if you have multiple instances, or if the default conflicts with your host's mDNS daemon (common on NAS devices like UGreen, Synology, etc.)
- Must be run on host network. This is required to support multicasting which is needed for Airprint.
docker run --name cups --restart unless-stopped --net host\
-v <your config dir>:/config \
-e CUPSADMIN="<username>" \
-e CUPSPASSWORD="<password>" \
chuckcharlie/cups-avahi-airprint:latest
services:
cups:
image: chuckcharlie/cups-avahi-airprint:latest
container_name: cups
network_mode: host
volumes:
- ./config:/config
environment:
CUPSADMIN: "<YourAdminUsername>"
CUPSPASSWORD: "<YourPassword>"
restart: unless-stopped- CUPS will be configurable at http://[host ip]:631 using the CUPSADMIN/CUPSPASSWORD.
- Make sure you select
Share This Printerwhen configuring the printer in CUPS.