-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
executable file
·67 lines (61 loc) · 1.89 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# ARG ARCH=amd64
FROM amd64/debian:bookworm-slim
# Install necessary packages, avoid installing unnecessary recommendations, and clean up after
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
locales \
cups \
cups-bsd \
cups-filters \
cups-pdf \
cups-client \
inotify-tools \
avahi-daemon \
avahi-utils \
avahi-discover \
python3 \
python3-dev \
python3-pip \
python3-setuptools \
python3-wheel \
python3-cups \
python3-avahi \
python3-lxml \
python3-dbus \
python3-gi \
python3-urllib3 \
wget \
rsync \
foomatic-db-compressed-ppds \
printer-driver-all \
openprinting-ppds \
hpijs-ppds \
hp-ppd \
hplip \
printer-driver-splix \
printer-driver-gutenprint \
gutenprint-doc \
gutenprint-locales \
libgutenprint9 \
libgutenprint-doc \
ghostscript \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Expose CUPS and service directories
VOLUME ["/config", "/services"]
EXPOSE 631
# Add script to image and ensure it's executable
ADD app /app
RUN chmod +x /app/*
# Modify CUPS and Avahi configurations for remote access
RUN sed -i 's/Listen localhost:631/Listen *:631/' /etc/cups/cupsd.conf \
&& sed -i 's/Browsing No/Browsing On/' /etc/cups/cupsd.conf \
&& sed -i 's/<Location \/>/<Location \/>\n Allow All/' /etc/cups/cupsd.conf \
&& sed -i 's/<Location \/admin>/<Location \/admin>\n Allow All\n Require user @SYSTEM/' /etc/cups/cupsd.conf \
&& sed -i 's/<Location \/admin\/conf>/<Location \/admin\/conf>\n Allow All/' /etc/cups/cupsd.conf \
&& sed -i 's/.*enable\-dbus=.*/enable\-dbus=no/' /etc/avahi/avahi-daemon.conf \
&& echo "ServerAlias *" >> /etc/cups/cupsd.conf \
&& echo "DefaultEncryption Never" >> /etc/cups/cupsd.conf \
&& echo "BrowseWebIF Yes" >> /etc/cups/cupsd.conf
# Set the default command
CMD ["/app/run.sh"]