RagingTiger/cups-airprint

Enable AirPrint

Closed this issue · 3 comments

Hey, I've installed this container using docker-compose (ubuntu) and am able to access cups and print the test page from the GUI.
However I use the print function on my iOS device, it can't find the printer, is there a way to enable this or should it be enabled by default?

Once the container starts I move the .service file from /services to /etc/avahi/services and then restart the container.

tl;dr I have no experience with this problem .... unfortunately.

SHORT EXPLANATION
I have never had problems discovering the printer via iOS device ... granted I have never extensively printed using my iOS device ... I predominantly print from a macOS laptop.

LONG EXPLANATION
My usage case for this Docker image has always been to setup a Raspberry Pi on my local network (wired), install Docker, connect whatever printer(s) to it, deploy this image, configure everything, and print from my laptop.

I am also not the original author, and as such, have not extensively studied the scripts being used to configure the container. So I do not know what role the .service file plays in avahi discovery, or iOS. You might consider looking through the issues on the original author's GitHub repo: https://github.com/quadportnick/docker-cups-airprint.

I encountered the same problem as yours, and I have found a solution.

First, you have to make sure that your container is running in host network.

Then, you have to install avahi packages on your host machine.
sudo apt-get install avahi-daemon avahi-utils

Finally, you have to enable avahi reflector by modifying /etc/avahi/avahi-daemon.conf on your host machine.
Change #enable-reflector=no to enable-reflector=yes

Restart the avahi service on your host machine by running sudo service avahi-daemon restart and restart your container. Hopefully, you will find your printer on your iOS devices.

@gid204 Thanks a lot for providing this docker image.
It might make sense to add this info to the readme.

@hans362 Thank you, this helped out also in my case, using a RPi4 with Arch Linux.
With Arch Linux simply install the avahi package.
pacman -S avahi

Edit the config file, e.g. using nano
nano /etc/avahi/avahi-daemon.conf

Change #enable-reflector=no to enable-reflector=yes

Afterwards, start and enable the avahi daemon on host using
systemctl start avahi-daemon.service
systemctl enable avahi-daemon.service

After restart of the container it worked like a charm!