Dockerfile 1.31 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FROM golang:1.13 AS builder
MAINTAINER opl@deichman.no
WORKDIR /app
COPY kohaprinter.* .
RUN CGO_ENABLED=0 go build -o kohaprinter


FROM debian:testing

# Install Packages (basic tools, cups, basic drivers, HP drivers)
RUN apt-get update &&\
    dpkg --add-architecture i386 &&\
    apt-get install -y \
    sudo whois cups cups-client cups-bsd cups-filters foomatic-db-compressed-ppds printer-driver-all openprinting-ppds \
    hpijs-ppds hp-ppd hplip smbclient &&\
    apt-get clean

# 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

# Kohaprinter backend and extra cups drivers
COPY --from=builder /app/kohaprinter /usr/lib/cups/backend/
24
COPY drivers /drivers
25
26
COPY config/ /etc/cups/

27
28
29
# Brother label printer (32bit)
RUN dpkg -i --force-all --force-architecture /drivers/ql720nwpdrv-3.1.5-0.i386.deb && apt-get clean &&\
    rm -rf /var/lib/apt/lists/*
Benjamin Rokseth's avatar
Benjamin Rokseth committed
30

31
32
33
34
35
# Epson thermal printers
RUN dpkg -i /drivers/pcs-3.17.0.0-1.amd64.deb &&\
	dpkg -i /drivers/tmx-cups-backend-1.2.4.0-1.amd64.deb &&\
	dpkg -i /drivers/tmx-cups_1.2.2-1_amd64.deb &&\
	apt-get clean &&\
36
37
38
    rm -rf /var/lib/apt/lists/*
COPY startCups.sh /
CMD ["/startCups.sh"]