54 lines
1.6 KiB
Docker
54 lines
1.6 KiB
Docker
FROM alpine:3.24
|
|
|
|
ARG HPLIP_PLUGIN_VERSION=3.26.4
|
|
ARG HPLIP_PLUGIN_SHA256=199f78f8af7f36894d7180e9090963ce2550a75ec701f8a4ba37665a9746fdf0
|
|
|
|
RUN apk add --no-cache \
|
|
dbus \
|
|
gcompat \
|
|
hplip \
|
|
imagemagick \
|
|
imagemagick-pdf \
|
|
sane-backend-hpaio \
|
|
sane-utils \
|
|
tzdata
|
|
|
|
# The M1217 scanner needs HP's proprietary Marvell plug-in. HP ships it as a
|
|
# glibc binary, so gcompat is preloaded when SANE starts it on Alpine/musl.
|
|
RUN wget \
|
|
-q \
|
|
-O /tmp/hplip-plugin.run \
|
|
"https://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/hplip-${HPLIP_PLUGIN_VERSION}-plugin.run" \
|
|
&& echo "${HPLIP_PLUGIN_SHA256} /tmp/hplip-plugin.run" | sha256sum -c - \
|
|
&& mkdir -p /tmp/hplip-plugin /usr/share/hplip/scan/plugins \
|
|
&& sh /tmp/hplip-plugin.run \
|
|
--target /tmp/hplip-plugin \
|
|
--noexec \
|
|
>/dev/null \
|
|
&& install \
|
|
-m 0755 \
|
|
/tmp/hplip-plugin/bb_marvell-x86_64.so \
|
|
/usr/share/hplip/scan/plugins/bb_marvell-x86_64.so \
|
|
&& ln -sf \
|
|
/usr/share/hplip/scan/plugins/bb_marvell-x86_64.so \
|
|
/usr/share/hplip/scan/plugins/bb_marvell.so \
|
|
&& mkdir -p /var/lib/hp \
|
|
&& printf \
|
|
'[plugin]\ninstalled = 1\neula = 1\nversion = %s\n' \
|
|
"${HPLIP_PLUGIN_VERSION}" \
|
|
> /var/lib/hp/hplip.state \
|
|
&& chmod 0644 /var/lib/hp/hplip.state \
|
|
&& rm -rf /tmp/hplip-plugin /tmp/hplip-plugin.run
|
|
|
|
ENV LD_PRELOAD=/lib/libgcompat.so.0
|
|
|
|
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
|
COPY scan-one /usr/local/bin/scan-one
|
|
|
|
RUN chmod 0755 \
|
|
/usr/local/bin/docker-entrypoint.sh \
|
|
/usr/local/bin/scan-one
|
|
|
|
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
|
CMD ["/usr/local/bin/scan-one"]
|