From 06aaa6484d0d6bf883418f7aec0895cf72a0f68a Mon Sep 17 00:00:00 2001 From: manuc66 Date: Tue, 19 Nov 2024 21:51:50 +0100 Subject: [PATCH] enable other command than listen with docker, it should fix #1026 --- Dockerfile | 2 +- README.md | 4 ++++ root/app.sh | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e7abc9a..d161d82 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,7 +39,7 @@ RUN export SYS_ARCH=$(uname -m); \ && untar ${S6_SRC_URL}/${S6_VERSION}/s6-overlay-noarch.tar.xz \ && untar ${S6_SRC_URL}/${S6_VERSION}/s6-overlay-${S6_ARCH}.tar.xz \ echo "⬇️ Install shadow (for groupmod and usermod) and tzdata (for TZ env variable)" \ - && apk add --no-cache shadow tzdata + && apk add --no-cache shadow tzdata curl # add builded app WORKDIR /app diff --git a/README.md b/README.md index 930f126..d8852db 100644 --- a/README.md +++ b/README.md @@ -90,10 +90,14 @@ This will trigger a scan job as soon as the adf is loaded with paper Do run `npx node-hp-scan-to adf-autoscan --help` to get command line usage help +You can also set the environment `MAIN_COMMAND` to `adf-autoscan` with docker + #### `clear-registrations` This will clear all registered target on the device (useful for trial and error and debugging) Do run `npx node-hp-scan-to clear-registrations --help` to get command line usage help +You can also set the environment `MAIN_COMMAND` to `clear-registrations` with docker + ### Run with docker Public Pre-built Docker image: diff --git a/root/app.sh b/root/app.sh index efbf658..2eeea83 100755 --- a/root/app.sh +++ b/root/app.sh @@ -46,6 +46,10 @@ if [ ! -z "$CMDLINE" ]; then ARGS="${ARGS} ${CMDLINE}" fi +if [ ! -z "$MAIN_COMMAND" ]; then + ARGS="${MAIN_COMMAND} ${ARGS}" +fi + cd /app echo "Starting"