用docker搭建airprint服务,老旧打印机也能无线打印了

CUPS的github

chuckcharlie/cups-avahi-airprint: Docker image for CUPS intended as an AirPrint relay (github.com)

前提,需要有docker环境

1、将打印机连接好,并打开打印机电源

2、将以下命令复制到终端执行

a、创建配置目录:

mkdir -p ~/hass/airprint ~/hass/airprint/config ~/hass/airprint/services

b、创建容器:

docker run -dit 
--name=airprint 
--restart=always 
-p '631:631' 
-v /var/run/dbus:/var/run/dbus 
-v ~/hass/airprint/config:/config 
-v ~/hass/airprint/services:/services 
--device /dev/bus 
--device /dev/usb 
-e CUPSADMIN="admin" 
-e CUPSPASSWORD="admin" 
tigerj/cups-airprint:latest

3、浏览器打开   宿主机ip:631  ,添加共享打印机

用户名,密码都是admin。

最新版的

docker run -dit 
--name=airprint 
--restart=always 
-p '631:631' 
-v /var/run/dbus:/var/run/dbus 
-v ~/hass/airprint/config:/config 
-v ~/hass/airprint/services:/services 
--device /dev/bus 
--device /dev/usb 
-e CUPSADMIN="admin" 
-e CUPSPASSWORD="admin" 
ydkn/cups:latest

 

THE END
分享
二维码
< <上一篇
下一篇>>