-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
70 lines (60 loc) · 2.13 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
68
69
70
FROM ubuntu:22.04
MAINTAINER Butopêa <[email protected]>
ENV DEBIAN_FRONTEND noninteractive
# Install dependencies
RUN apt-get update -qq && apt-get upgrade -qqy \
&& apt-get install -qqy --no-install-recommends \
curl \
ca-certificates \
tzdata \
usbutils \
cups \
cups-filters \
cups-bsd \
libcupsimage2 \
printer-driver-all \
printer-driver-cups-pdf \
printer-driver-foo2zjs \
foomatic-db-compressed-ppds \
openprinting-ppds \
hpijs-ppds \
hp-ppd \
hplip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& rm /usr/lib/cups/backend/parallel \
&& rm /usr/lib/cups/backend/serial \
&& rm /usr/lib/cups/backend/cups-brf
# Setup PrintNode
RUN mkdir /usr/local/PrintNode \
&& curl -s https://dl.printnode.com/client/printnode/4.27.17/PrintNode-4.27.17-ubuntu-22.04-x86_64.tar.gz -o /tmp/printnode.tar.gz \
&& echo "d767740faf8f9b6977ad7b8fe9201dfb225c6378 /tmp/printnode.tar.gz" | sha1sum -c - \
&& tar -xzf /tmp/printnode.tar.gz -C /usr/local/PrintNode --strip-components 1 \
&& rm /tmp/printnode.tar.gz
# ENV variables
ENV TZ "Europe/Budapest"
ENV CUPSADMIN print
ENV CUPSPASSWORD print
ENV PRINTNODE_HOSTNAME docker
# Config file changes
RUN sed -i 's/Listen localhost:631/Listen 0.0.0.0:631/' /etc/cups/cupsd.conf && \
sed -i 's/Browsing Off/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 && \
echo "ServerAlias *" >> /etc/cups/cupsd.conf && \
echo "DefaultEncryption Never" >> /etc/cups/cupsd.conf
# Add custom drivers
COPY custom_drivers_filters/ /
RUN chmod 755 /usr/lib/cups/*
# Backup of Cups folder in case users do not add their own
RUN cp -rp /etc/cups /etc/cups-bak
VOLUME [ "/etc/cups" ]
# Cups ports
EXPOSE 631
EXPOSE 5353/udp
# Printnode Webinterface port
EXPOSE 8888
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
CMD ["/entrypoint.sh"]