Coder Social home page Coder Social logo

docker-cups's Introduction

CUPS Docker Image

docker-compose

version: '2.4'
services:
  cups:
    image: xjasonlyu/cups:latest
    ports:
      - '631:631/tcp'
    volumes:
      - '/docker/cups:/etc/cups'
      - '/var/run/dbus:/var/run/dbus'
    restart: always
    privileged: true
    network_mode: bridge
    container_name: cups

AirPrint Support

Install avahi-daemon service

apt install -y avahi-daemon
systemctl enable avahi-daemon
systemctl restart avahi-daemon

Restart CUPS when USB plug in

My printer: Samsung ML-1670 Series

List USB devices

$ lsusb
Bus 001 Device 005: ID 04e8:3313 Samsung Electronics Co., Ltd
Bus 001 Device 003: ID 0424:ec00 Microchip Technology, Inc. (formerly SMSC) SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Microchip Technology, Inc. (formerly SMSC) SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Check details

$ udevadm info -a -p $(udevadm info -q path -n /dev/bus/usb/001/005)
looking at device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2':
  KERNEL=="1-1.2"
  SUBSYSTEM=="usb"
  DRIVER=="usb"
  ATTR{serial}=="xxxxxxx"
  ATTR{removable}=="removable"
  ATTR{idVendor}=="04e8"
  ATTR{devspec}=="(null)"
  ATTR{speed}=="480"
  ATTR{manufacturer}=="Samsung Electronics Co., Ltd."
  ATTR{version}==" 2.00"
  ATTR{bMaxPacketSize0}=="64"
  ATTR{bmAttributes}=="c0"
  ATTR{configuration}==""
  ATTR{idProduct}=="3313"
  ATTR{bDeviceProtocol}=="00"
  ATTR{product}=="ML-1670 Series"
  ATTR{busnum}=="1"
  ATTR{tx_lanes}=="1"
  ATTR{bDeviceClass}=="00"
  ATTR{ltm_capable}=="no"
  ATTR{devnum}=="5"
  ATTR{rx_lanes}=="1"
  ATTR{authorized}=="1"
  ATTR{bMaxPower}=="2mA"
  ATTR{quirks}=="0x0"
  ATTR{avoid_reset_quirk}=="0"
  ATTR{bNumConfigurations}=="1"
  ATTR{bcdDevice}=="0100"
  ATTR{devpath}=="1.2"
  ATTR{bConfigurationValue}=="1"
  ATTR{bDeviceSubClass}=="00"
  ATTR{urbnum}=="160"
  ATTR{bNumInterfaces}==" 1"
  ATTR{maxchild}=="0"

Creating a new file in /etc/udev/rules.d/

vim /etc/udev/rules.d/10-reload.cups.rules

Put following line in that file

ACTION=="add", SUBSYSTEM=="usb", ATTRS{product}=="ML-1670 Series", RUN+="/bin/sh -c 'docker ps -f name=cups | grep cups && docker restart cups'"

Reload udev rules

udevadm control --reload-rules

docker-cups's People

Contributors

xjasonlyu avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.