forked from asmw/brother-scan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
44 lines (34 loc) · 1.21 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
FROM python:3.9
ARG BRSCAN_DEB=brscan4-0.4.10-1.amd64.deb
#deprecated MAINTAINER [email protected]
# This is where the scan output will be written to
VOLUME /output
VOLUME /consume
# This must be mapped to ${ADVERTISE_IP}:54925
EXPOSE 54925/udp
# Install required Debian packages
RUN apt-get update -q \
&& apt-get install -q -y sane sane-utils poppler-utils libusb-0.1-4 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install required python modules
COPY requirements.txt /tmp/
RUN pip install -r /tmp/requirements.txt
# RUN pip uninstall pysnmp
# RUN pip uninstall pysnmp-pyasn1
# RUN pip uninstall pysnmp-pysmi
# RUN pip install git+https://github.com/pysnmp/pysnmp.git#egg=pysnmp
# Install Brother scanner driver
COPY $BRSCAN_DEB /tmp/
RUN dpkg --install /tmp/brscan4-*.deb
# Fixup symbolic links
RUN mkdir /usr/lib/sane \
&& for f in /usr/lib64/sane/libsane-brother*;do ln -s $f /usr/lib/sane/;done
# Install brscan (run "setup.py build sdist" before docker build)
COPY dist/brscan-*.tar.gz /tmp/
RUN pip install --no-binary :all: /tmp/brscan-*.tar.gz
# Disable ImageMagick policies for now
RUN rm /etc/ImageMagick-6/policy.xml
# Add run script and set it as default command
ADD run.sh /
CMD /run.sh