Linux/CUPS

From Wiki

CUPS server

  • docker-compose.yml
version: '3.3'
services:
  cupsd:
    build: ./build
    container_name: cupsd
    restart: unless-stopped
    ports:
      - '631:631'
    volumes:
      - /srv/docker-data/cups/etc:/etc/cups
  • Dockerfile
FROM ubuntu:latest

RUN dpkg --add-architecture i386 && \
    apt update -qq && \
    RUNLEVEL=1 DEBIAN_FRONTEND=noninteractive \
    apt install -y \
      sudo \
      whois \
      usbutils \
      cups \
      cups-client \
      cups-bsd \
      cups-filters \
      foomatic-db-compressed-ppds \
      printer-driver-all \
      openprinting-ppds \
      hpijs-ppds \
      hp-ppd \
      hplip \
      wget unzip \
      smbclient \
      printer-driver-cups-pdf && \
    apt install -y \
      libcupsimage2:i386 libstdc++6:i386 && \
    wget -P /dell-driver https://download.support.xerox.com/pub/drivers/6000/drivers/linux/en_GB/6000_6010_deb_1.01_20110210.zip && \
    unzip /dell-driver/6000_6010_deb_1.01_20110210.zip -d /dell-driver && \
    dpkg -i /dell-driver/deb_1.01_20110210/*.deb && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

# Add user and disable sudo password checking
RUN useradd \
  --groups=sudo,lp,lpadmin \
  --create-home \
  --home-dir=/home/print \
  --shell=/bin/bash \
  --password=$(mkpasswd print) \
  print \
&& sed -i '/%sudo[[:space:]]/ s/ALL[[:space:]]*$/NOPASSWD:ALL/' /etc/sudoers

# Copy the default configuration file
COPY --chown=root:lp cupsd.conf /etc/cups/cupsd.conf

# Default shell
CMD ["/usr/sbin/cupsd", "-f"]
  • cupsd.conf


Printing from command line

/usr/bin/lp -h 192.168.111.11:631 -d Zebra-ZD230 -n 1 /fileshare/02_label.png