从docker容器内打印

随着GUI应用程序的涌入移植到docker,从docker容器内打印到杯子的最佳方法是什么?

注意:我不打算从容器内部运行杯子,因为这打破了与docker相关的单一服务范例.

最佳答案
自我记录调查工作后如何实现这一目标.

使用基于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传递到容器中,我就能按预期打印.

相关文章

Docker是什么Docker是 Docker.Inc 公司开源的一个基于 LXC技...
本文为原创,原始地址为:http://www.cnblogs.com/fengzheng...
镜像操作列出镜像:$ sudo docker imagesREPOSITORY TAG IMA...
本文原创,原文地址为:http://www.cnblogs.com/fengzheng/p...
在 Docker 中,如果你修改了一个容器的内容并希望将这些更改...
在Docker中,--privileged 参数给予容器内的进程几乎相同的权...