随着 GUI 应用程序被移植到 Docker 上,从 Docker 容器内部打印到 CUPS 的最佳方法是什么?
NB: 我不希望在容器内运行 CUPS,因为这会破坏与 Docker 相关的单个服务范例。
在研究如何实现这个目标后,自描述性有所提升。
在基于Ubuntu的Docker主机上,将打印机安装在杯子插座中效果良好...(acroread无法填充打印机),然而在Redhat主机上失败了。
...
-v /var/run/cups:/var/run/cups:ro
...
填充cups 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 <DOCKER0 BRIDGE IP>
以及Docker启动参数:
...
-v /tmp/client.conf:/etc/cups/client.conf:ro \
...
我还必须确保cups服务器绑定到docker0桥,并允许其他设备访问cups服务器:
...
Listen *:631
...
<Location />
Order allow,deny
Allow all
</Location>
...
一旦cups重新启动并将cups client.conf传递到容器中,我就能按预期进行打印。
client.conf
的文件,路径为/tmp/client.conf
,然后将其挂载到容器内的路径/etc/cups/client.conf
(只读)。您是从Docker容器中打印还是从主机打印到Docker容器中? - waspinator