Provides a Docker image for CUPS with:
- Canon LBP-810 CAPT driver (
capt_lbp810-1120) - official Linux TSPL filters from iDPRT (
raster-tspl,raster-esc) - fixed TSPL queue profiles generated from the filter-compatible iDPRT
sp410.tspl.ppdwith hard-wired media,PaperType=1,203dpi, and noCustomPageSize:TDP-245-fixed-tspl.ppdfor30 x 20 mmTDP-245-fixed-58x40-tspl.ppdfor58 x 40 mm
- Copy
compose.ymlto the server with the attached printer. - Build the image. It generates fixed
30 x 20 mmand58 x 40 mm,gap 2 mmlabel profiles inDockerfile:docker compose build docker compose up -d
compose.ymlpinslinux/amd64because the official iDPRT TSPL package ships x64/x86 filters only. - Discover the stable USB URI:
docker compose exec cups lpinfo -v - Add Canon LBP-810:
docker compose exec cups lpadmin -p Canon-LBP-810 -E -v 'usb://...' -P /usr/share/cups/model/Canon-LBP-810-capt.ppd
- Add the fixed TSPL/XPrinter queue you need:
docker compose exec cups lpadmin -p XPrinter-30x20 -E -v 'usb://...' -P /usr/share/cups/model/tspl/TDP-245-fixed-tspl.ppd docker compose exec cups lpadmin -p XPrinter-58x40 -E -v 'usb://...' -P /usr/share/cups/model/tspl/TDP-245-fixed-58x40-tspl.ppd
- Add the network printer to the client OS by IPP/LPD using host
<host>:631.
You can generate another fixed PPD manually if you need a different hard-coded size:
python3 /usr/local/bin/generate_tdp245_ppd.py \
/usr/share/cups/model/tspl/sp410.tspl.ppd \
/usr/share/cups/model/tspl/TDP-245-fixed-tspl.ppd \
30 20 2The generator interface is:
generate_tdp245_ppd.py SOURCE_PPD DEST_PPD WIDTH_MM HEIGHT_MM GAP_MMImportant limitation: with the current official raster-tspl filter path, only GAP 2 mm is confirmed to propagate correctly. The generator accepts gap_mm as an explicit parameter, but currently rejects values other than 2 so the queue does not claim unsupported behavior.
This fixed-profile approach is the safer option for browser/GUI printing because the client only sees one paper size and cannot pick 20 x 30, 4x6, or arbitrary CustomPageSize values from printer capabilities. It does not fully prevent browser-side scaling or orientation overrides, but it removes the main server-side media mismatch.
With the current compose setup, CUPS sees the real USB bus and can return stable usb://... URIs that usually include device identity data such as vendor, model, and serial. Prefer that URI over /dev/usb/lp*, because it survives cable replugging and port changes much better.
The printer identifies itself over USB as G2010 series (04a9:183a). Gutenprint has no
G2010/G2415 entry, but the G3010 driver (same print engine, G3010 = G2010 + Wi-Fi) works
over USB. The printer does not support IPP-over-USB, so -m everywhere fails.
- Discover the stable USB URI:
docker compose exec cups lpinfo -v | grep -i canon
- Add the black-and-white queue using the bundled PPD:
docker compose exec cups lpadmin -p Canon-G2415 -E -v 'usb://Canon/G2010%20series?serial=046F8E&interface=1' -P /etc/cups/ppd/Canon-G2415-bw.ppd
ppd/Canon-G2415-bw.ppdis a Gutenprint G3010 PPD restricted toGray(default) andBlackColorModelchoices, so the queue cannot print in color. It also accepts the client optionA4.Borderlessas a compatibility alias and maps it to normal A4 with the printer's real margins; it does not make the G2415 a true borderless printer.
Notes:
- The kernel
usblpdriver can grab the printer interface and break the CUPS USB backend. Detach it (needed once per printer reconnect):Find the exact sysfs name withecho '<bus>-<port>:1.1' | sudo tee /sys/bus/usb/drivers/usblp/unbind
ls /sys/bus/usb/drivers/usblp/. - After editing a PPD, restart the container (
docker compose restart cups) so cupsd reloads it.
CUPS handles printing only. The Canon G2415/G2010 USB device is detected by
SANE's pixma backend, so this image also runs saned on TCP port 6566.
The compose file publishes that port and allows the local 192.168.8.0/24
network in sane/saned.conf.
After rebuilding and redeploying the image, configure a client with:
sudo apt install sane-utils
printf 'net:192.168.8.43\n' | sudo tee /etc/sane.d/net.conf
scanimage -L
scanimage --format=png --resolution 300 > scan.pngFor clients that use an explicit SANE server URI, use net:192.168.8.43.
The Canon must be connected to the server and visible in /dev/bus/usb; a
different USB printer or a disconnected Canon cannot be scanned. Do not run
scanimage -L inside the CUPS container without a D-Bus system bus: some
Debian builds abort there while sane-find-scanner and the network client
work normally.
The saned service shares the container's USB bus with CUPS. Keep one active
print or scan operation at a time, and detach usblp from the Canon interface
if the device is visible to USB but unavailable to either backend.
Install avahi:
apt install avahi-daemonTo enable printer discovery on the network, add files:
/etc/avahi/services/cups-lbp810.service:
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">Canon LBP-810 on %h</name>
<service>
<type>_ipp._tcp</type>
<subtype>_universal._sub._ipp._tcp</subtype>
<port>631</port>
<txt-record>txtvers=1</txt-record>
<txt-record>qtotal=1</txt-record>
<txt-record>rp=printers/Canon-LBP-810</txt-record>
<txt-record>ty=Canon LBP-810</txt-record>
<txt-record>product=(Canon LBP-810 via CUPS)</txt-record>
<txt-record>note=AirPrint via CUPS</txt-record>
<txt-record>adminurl=http://%h:631/printers/Canon-LBP-810</txt-record>
<txt-record>URF=none</txt-record>
<txt-record>pdl=application/pdf,application/postscript,image/urf</txt-record>
<txt-record>Color=F</txt-record>
<txt-record>Duplex=F</txt-record>
</service>
</service-group>/etc/avahi/services/cups-xprinter.service:
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">XPrinter 30x20mm</name>
<service>
<type>_ipp._tcp</type>
<subtype>_universal._sub._ipp._tcp</subtype>
<port>631</port>
<txt-record>txtvers=1</txt-record>
<txt-record>qtotal=1</txt-record>
<txt-record>rp=printers/XPrinter-30x20</txt-record>
<txt-record>ty=XPrinter 30x20mm</txt-record>
<txt-record>product=(TSPL printer via CUPS)</txt-record>
<txt-record>adminurl=http://%h:631/printers/XPrinter-30x20</txt-record>
<txt-record>URF=none</txt-record>
<txt-record>pdl=application/pdf,application/postscript,image/urf</txt-record>
<txt-record>Color=F</txt-record>
<txt-record>Duplex=F</txt-record>
</service>
</service-group>/etc/avahi/services/cups-xprinter-58x40.service:
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">XPrinter 58x40mm</name>
<service>
<type>_ipp._tcp</type>
<subtype>_universal._sub._ipp._tcp</subtype>
<port>631</port>
<txt-record>txtvers=1</txt-record>
<txt-record>qtotal=1</txt-record>
<txt-record>rp=printers/XPrinter-58x40</txt-record>
<txt-record>ty=XPrinter 58x40mm</txt-record>
<txt-record>product=(TSPL printer via CUPS)</txt-record>
<txt-record>adminurl=http://%h:631/printers/XPrinter-58x40</txt-record>
<txt-record>URF=none</txt-record>
<txt-record>pdl=application/pdf,application/postscript,image/urf</txt-record>
<txt-record>Color=F</txt-record>
<txt-record>Duplex=F</txt-record>
</service>
</service-group>Restart Avahi:
systemctl restart avahi-daemon/etc/avahi/services/cups-g2415.service:
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">Canon G2415 on %h</name>
<service>
<type>_ipp._tcp</type>
<subtype>_universal._sub._ipp._tcp</subtype>
<port>631</port>
<txt-record>txtvers=1</txt-record>
<txt-record>qtotal=1</txt-record>
<txt-record>rp=printers/Canon-G2415</txt-record>
<txt-record>ty=Canon PIXMA G2415</txt-record>
<txt-record>product=(Canon G2415 via CUPS)</txt-record>
<txt-record>adminurl=http://%h:631/printers/Canon-G2415</txt-record>
<txt-record>URF=none</txt-record>
<txt-record>pdl=application/pdf,application/postscript,image/urf</txt-record>
<txt-record>Color=F</txt-record>
<txt-record>Duplex=F</txt-record>
</service>
</service-group>