-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathDockerfile
63 lines (54 loc) · 1.61 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
ARG BUILD_FROM
FROM $BUILD_FROM
LABEL io.hass.version="1.5" io.hass.type="addon" io.hass.arch="aarch64|amd64"
# Set shell
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt update \
&& apt install -y --no-install-recommends \
sudo \
locales \
cups \
cups-filters \
avahi-daemon \
libnss-mdns \
dbus \
colord \
printer-driver-all-enforce \
printer-driver-all \
printer-driver-splix \
printer-driver-brlaser \
printer-driver-gutenprint \
openprinting-ppds \
hpijs-ppds \
hp-ppd \
hplip \
cups-pdf \
gnupg2 \
lsb-release \
nano \
samba \
bash-completion \
procps \
whois \
&& apt clean -y \
&& rm -rf /var/lib/apt/lists/*
# Add Canon cnijfilter2 driver
RUN cd /tmp \
&& if [ "$(arch)" = 'x86_64' ]; then ARCH="amd64"; else ARCH="arm64"; fi \
&& curl https://gdlp01.c-wss.com/gds/0/0100012300/02/cnijfilter2-6.80-1-deb.tar.gz -o cnijfilter2.tar.gz \
&& tar -xvf ./cnijfilter2.tar.gz cnijfilter2-6.80-1-deb/packages/cnijfilter2_6.80-1_${ARCH}.deb \
&& mv cnijfilter2-6.80-1-deb/packages/cnijfilter2_6.80-1_${ARCH}.deb cnijfilter2_6.80-1.deb \
&& apt install ./cnijfilter2_6.80-1.deb
COPY rootfs /
# 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
EXPOSE 631
RUN chmod a+x /run.sh
CMD ["/run.sh"]