-
Notifications
You must be signed in to change notification settings - Fork 379
CUPS printer in container
mviereck edited this page Jul 24, 2019
·
3 revisions
- Check output of
lpstat -H
. It should point to a socket, normally/run/cups/cups.sock
. - Share CUPS socket with container:
--volume /run/cups/cups.sock:/run/cups/cups.sock
- Set environment variable
CUPS_SERVER
with:--env CUPS_SERVER=/run/cups/cups.sock
- The docker image needs package
libcups
orlibcups2
.
x11docker provides CUPS printer sharing with option --printer
.
To access CUPS printer server over TCP you must allow access in /etc/cups/cupsd.conf
:
Port 631
<Location />
# Allow remote access...
Order allow,deny
Allow 172.17.0.*
Allow 127.0.0.1
# Allow all
</Location>
- The IP mask
172.17.0.*
matches the IP range of Docker containers. - Set environment variable
--env CUPS_SERVER=172.17.0.1:631
.- IP
172.17.0.1
is the IP adress of the Docker daemon on host. Compare output ofip -4 a | grep docker
- x11docker supports CUPS over TCP with option
--printer=tcp
.
- IP