Created
May 29, 2022 13:22
-
-
Save rwese/f345ebba4136542d5d0c735686668155 to your computer and use it in GitHub Desktop.
saneimage -L inside docker container
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ATTENTION: this is not secure and must not be used in any production environment | |
# | |
# to work it needs the following extra mappings and permissions | |
# | |
# * --net host for the discovery process, which is otherwise blocked by certain iptables rules, at least in my case this was the easiest solution | |
# * --privileged to access the devices at all | |
# * dbus bind-mounts for the devices discovered by the os | |
# | |
# build the debian-sane image | |
export DOCKER_IMAGE_NAME=debian-sane | |
docker build -t "${DOCKER_IMAGE_NAME}" - <<DOCKERFILE | |
FROM debian:bookworm-slim | |
RUN apt update -y && apt install -y sane-utils | |
DOCKERFILE | |
# attempt search | |
docker run \ | |
--net host \ | |
--privileged \ | |
-v /var/run/dbus:/var/run/dbus \ | |
-v /dev/bus/usb:/dev/bus/usb \ | |
--rm -it "${DOCKER_IMAGE_NAME}" scanimage -L |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment