chuckcharlie / cups-avahi-airprint

Docker image for CUPS intended as an AirPrint relay
GNU General Public License v3.0
123 stars 67 forks source link

Unable to save PPD file: Permission denied #29

Open andykelk opened 8 months ago

andykelk commented 8 months ago

I'm unable to add a new USB printer using this container. I got it to detect the printer and selected a driver but it fails with an error "Unable to save PPD file: Permission denied". In the cups logs, I get: Unable to create "/etc/cups/ppd/Brother_DCP-1510_series.ppd.N": Permission denied

My docker-compose file has:

services:
  cups:
    image: chuckcharlie/cups-avahi-airprint:latest
    container_name: cups
    network_mode: host
    volumes:
      - ./services:/services
      - ./config:/config
      - /run/dbus:/run/dbus
      - /dev/bus/usb:/dev/bus/usb
    privileged: true
    environment:
      CUPSADMIN: "xx"
      CUPSPASSWORD: "xx"
    restart: unless-stopped

If I get a shell inside the container, I can touch a file in that directory:

/ # ls -l /etc/cups/ppd/
total 0
-rw-r--r--    1 root     root             0 Jan 20 08:31 Brother_DCP-1510_series.ppd.N

and it shows up on the host:

~/docker/cups$ ls -l config/ppd/
total 0
-rw-r--r-- 1 root root 0 Jan 20 19:31 Brother_DCP-1510_series.ppd.N

This is running on a fresh install of Ubuntu server 22.04.3 LTS using the distro installed docker.io and docker-compose packages. I did originally have the snap version of docker installed but I removed that to try and eliminate it as a cause.

asmerkin commented 1 month ago

- /dev/bus/usb:/dev/bus/usb this line goes under devices, not under volumes