做了个 oa 办公系统,最近在做一个打印附件的功能。通过 aspose-word java 在 windows 开发环境下没有问题
但是在 docker 容器中发现调用不到打印。现在仅能找到的资料有
...
-v /var/run/cups:/var/run/cups:ro
...
填充杯子 client.conf 似乎是一个更好的解决方案.
cat /tmp/client.conf
#The ServerName directive specifies sets the remote server
that is to be used for all client operations. That is,it
redirects all client requests to the remote server. The
default port number is 631 but can be overridden by adding
a colon followed by the desired port number to the value.
The default is to use the local server ("localhost").
ServerName
和 docker 启动参数:
...
-v /tmp/client.conf:/etc/cups/client.conf:ro
...
我还必须确保 cups 服务器绑定到 docker0 网桥并允许其他设备访问 cups 服务器:
...
Listen *:631
...
一旦杯子重新启动并且杯子 client.conf 传递到容器中,我就能按预期打印.