Fix .deb source staging — preserve app/ subdir for Dockerfile

build-deb.sh used 'cp -r app/ source/' which renames app to source
when source doesn't yet exist, dropping the app/ wrapper that the
Dockerfile's COPY app/ /app/ depends on. The 2>/dev/null || true
on the cp lines hid the resulting failures, so the .deb shipped a
broken /opt/dupfinder/source/ that build-from-source could not use.

Pre-create the source dir and copy each item to its explicit
destination path. Bump package version to 1.0.1.

Also rework dupfinder-setup.sh's image-prep step: prefer a local
image, then a quiet registry pull, then build from the bundled
source. Removes the loud registry-not-found error that scared users
when the (unpublished) tocmo0nlord/dupfinder image wasn't on Docker
Hub.
This commit is contained in:
Carlos
2026-04-24 01:05:53 -04:00
parent 76e89a7313
commit 077fbd7e8f
3 changed files with 38 additions and 20 deletions

View File

@@ -128,22 +128,24 @@ read -rp " Web port [$APP_PORT]: " INPUT
[[ -n "$INPUT" ]] && APP_PORT="$INPUT"
ok "Port: $APP_PORT"
# ── Pull Docker image ─────────────────────────────────────────────────────────
# ── Build (or pull) Docker image ──────────────────────────────────────────────
# The .deb ships the full source tree, so building locally is the default.
# Registry pull is tried only as a quick path if the image happens to be
# published; failures are silent.
echo ""
info "Pulling Docker image ($IMAGE_NAME)..."
if docker pull "$IMAGE_NAME"; then
ok "Image pulled"
info "Preparing Docker image ($IMAGE_NAME)..."
if docker image inspect "$IMAGE_NAME" >/dev/null 2>&1; then
ok "Image already present locally"
elif docker pull "$IMAGE_NAME" >/dev/null 2>&1; then
ok "Image pulled from registry"
elif [[ -f "$COMPOSE_DIR/source/Dockerfile" ]]; then
echo " Building image from bundled source (one-time, ~5-10 min)..."
docker build -t "$IMAGE_NAME" "$COMPOSE_DIR/source"
ok "Image built from source"
else
echo ""
echo " Could not pull from registry. Trying to build from source..."
if [[ -f "$COMPOSE_DIR/source/Dockerfile" ]]; then
docker build -t "$IMAGE_NAME" "$COMPOSE_DIR/source"
ok "Image built from source"
else
err "Neither pull nor local build succeeded."
echo " Make sure you have internet access or the source files are present."
exit 1
fi
err "No image available and no source bundled. Reinstall the .deb."
exit 1
fi
# ── Write config + override ───────────────────────────────────────────────────