Changed to Alpine base and removed Brother drivers. Generic postscript

works just fine.
This commit is contained in:
root
2018-09-20 13:33:02 -05:00
parent 1184fdd2a9
commit a9147759b5
4 changed files with 33 additions and 19 deletions

View File

@@ -1,16 +1,29 @@
FROM ubuntu:bionic FROM alpine:latest
# Add repos
RUN echo 'deb [trusted=yes] http://www.openprinting.org/download/printdriver/debian/ lsb3.2 main contrib main-nonfree' >> /etc/apt/sources.list.d/multiverse.list
# Install the packages we need. Avahi will be included # Install the packages we need. Avahi will be included
RUN apt-get update && apt-get install -y \ RUN echo "http://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories &&\
brother-lpr-drivers-extra brother-cups-wrapper-extra openprinting-ppds-postscript-brother\ apk add --update cups cups-libs cups-pdf cups-client \
cups \ cups-filters \
cups-pdf \ cups-dev \
ghostscript \
avahi \
inotify-tools \ inotify-tools \
python-cups \ python \
&& rm -rf /var/lib/apt/lists/* python-dev \
py-pip \
build-base \
wget \
&& pip --no-cache-dir install --upgrade pip \
&& pip install pycups \
&& rm -rf /var/cache/apk/*
#RUN apt-get update && apt-get install -y \
# brother-lpr-drivers-extra brother-cups-wrapper-extra openprinting-ppds-postscript-brother\
# cups \
# cups-pdf \
# inotify-tools \
# python-cups \
#&& rm -rf /var/lib/apt/lists/*
# This will use port 631 # This will use port 631
EXPOSE 631 EXPOSE 631
@@ -35,4 +48,3 @@ RUN sed -i 's/Listen localhost:631/Listen 0.0.0.0:631/' /etc/cups/cupsd.conf &&
sed -i 's/.*enable\-dbus=.*/enable\-dbus\=no/' /etc/avahi/avahi-daemon.conf && \ sed -i 's/.*enable\-dbus=.*/enable\-dbus\=no/' /etc/avahi/avahi-daemon.conf && \
echo "ServerAlias *" >> /etc/cups/cupsd.conf && \ echo "ServerAlias *" >> /etc/cups/cupsd.conf && \
echo "DefaultEncryption Never" >> /etc/cups/cupsd.conf echo "DefaultEncryption Never" >> /etc/cups/cupsd.conf

View File

@@ -1,8 +1,8 @@
# chuckcharlie/cups-airprint-brother # chuckcharlie/cups-avahi-airprint
Fork from [quadportnick/docker-cups-airprint](https://github.com/quadportnick/docker-cups-airprint) Fork from [quadportnick/docker-cups-airprint](https://github.com/quadportnick/docker-cups-airprint)
This Ubuntu-based Docker image runs a CUPS instance that is meant as an AirPrint relay for printers that are already on the network but not AirPrint capable. The other images out there never seemed to work right and didn't support many Brother printers. I forked the original to add more printer support, use the latest Ubuntu base, and work on more host OS's. This Alpine-based Docker image runs a CUPS instance that is meant as an AirPrint relay for printers that are already on the network but not AirPrint capable. The other images out there never seemed to work right. I forked the original to use the Alpine instead of Ubuntu and work on more host OS's.
## Configuration ## Configuration
@@ -24,10 +24,11 @@ docker run --name cups --restart unless-stopped --net host\
-v <your config dir>:/config \ -v <your config dir>:/config \
-e CUPSADMIN="<username>" \ -e CUPSADMIN="<username>" \
-e CUPSPASSWORD="<password>" \ -e CUPSPASSWORD="<password>" \
chuckcharlie/cups-airprint-brother:latest chuckcharlie/cups-avahi-airprint:latest
``` ```
## Add and set up printer: ## Add and set up printer:
* CUPS will be configurable at http://[host ip]:631 using the CUPSADMIN/CUPSPASSWORD. * CUPS will be configurable at http://[host ip]:631 using the CUPSADMIN/CUPSPASSWORD.
* Make sure you select `Share This Printer` when configuring the printer in CUPS. * Make sure you select `Share This Printer` when configuring the printer in CUPS.
* ***After configuring your printer, you need to close the web browser for at least 60 seconds. CUPS will not write the config files until it detects the connection is closed for as long as a minute.***

View File

@@ -1,5 +1,5 @@
#!/bin/bash #!/bin/sh
inotifywait -m -e close_write,moved_to,create /etc/cups | /usr/bin/inotifywait -m -e close_write,moved_to,create /etc/cups |
while read -r directory events filename; do while read -r directory events filename; do
if [ "$filename" = "printers.conf" ]; then if [ "$filename" = "printers.conf" ]; then
rm -rf /services/AirPrint-*.service rm -rf /services/AirPrint-*.service

View File

@@ -3,18 +3,19 @@ set -e
set -x set -x
if [ $(grep -ci $CUPSADMIN /etc/shadow) -eq 0 ]; then if [ $(grep -ci $CUPSADMIN /etc/shadow) -eq 0 ]; then
useradd -r -G lpadmin -M $CUPSADMIN adduser -S -G lpadmin --no-create-home $CUPSADMIN
fi fi
echo $CUPSADMIN:$CUPSPASSWORD | chpasswd echo $CUPSADMIN:$CUPSPASSWORD | chpasswd
mkdir -p /config/ppd mkdir -p /config/ppd
mkdir -p /services mkdir -p /services
rm -rf /etc/avahi/services/*
rm -rf /etc/cups/ppd rm -rf /etc/cups/ppd
ln -s /config/ppd /etc/cups ln -s /config/ppd /etc/cups
if [ ls /services/*.service ]; then if [ `ls -l /services/*.service 2>/dev/null | wc -l` -gt 0 ]; then
cp -f /services/*.service /etc/avahi/services/ cp -f /services/*.service /etc/avahi/services/
fi fi
if [ ! -f /config/printers.conf ]; then if [ `ls -l /config/printers.conf 2>/dev/null | wc -l` -eq 0 ]; then
touch /config/printers.conf touch /config/printers.conf
fi fi
cp /config/printers.conf /etc/cups/printers.conf cp /config/printers.conf /etc/cups/printers.conf