随着GUI应用程序的涌入移植到docker,从docker容器内打印到杯子的最佳方法是什么?
注意:我不打算从容器内部运行杯子,因为这打破了与docker相关的单一服务范例.
最佳答案
自我记录调查工作后如何实现这一目标.
原文链接:https://www.f2er.com/docker/436231.html使用基于Ubuntu的docker主机安装在杯子插槽中工作得很好… ish(acroread无法填充打印机),但是使用Redhat主机失败了.
...
-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传递到容器中,我就能按预期打印.