从docker集装箱内打印

随着将GUI应用程序移植到Docker,从Docker容器中打印杯子的最佳方法是什么?

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

经过调查后自我logging如何实现这一目标。

挂在杯子套接字工作很好… ish(acroread无法填充打印机)与基于Ubuntu的docker主机,但是这与红帽主机失败。

... -v /var/run/cups:/var/run/cups:ro ... 

填充杯子client.conf似乎是一个更好的解决scheme。

 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> ... 

一旦杯子重新启动,杯子client.conf传递到容器我能够按预期打印。