This commit is contained in:
unknown
2025-12-11 05:19:07 -08:00
parent 77dc720821
commit 404dbe74f5

View File

@@ -1,4 +1,4 @@
ARG PYTHON_VERSION=3.10
ARG PYTHON_VERSION=3.12
FROM python:${PYTHON_VERSION}-slim-bookworm
ARG APP_VERSION=25.12.12
@@ -10,8 +10,8 @@ LABEL org.opencontainers.image.title="ebook2audiobook" \
org.opencontainers.image.source="https://github.com/DrewThomasson/ebook2audiobook"
ARG DEVICE_TAG=cpu
ARG DOCKER_DEVICE_STR
ARG DOCKER_PROGRAMS_STR
ARG DOCKER_DEVICE_STR='{"name": "cpu", "os": "linux", "arch": "x86_64", "pyvenv": [3, 12], "tag": "cpu", "note": ""}'
ARG DOCKER_PROGRAMS_STR=cmake libgomp1 libfontconfig1 libsndfile1 curl ffmpeg nodejs espeak-ng sox tesseract-ocr
ARG CALIBRE_INSTALLER_URL="https://download.calibre-ebook.com/linux-installer.sh"
ARG ISO3_LANG=eng
@@ -33,7 +33,14 @@ RUN apt-get update && \
tesseract-ocr-${ISO3_LANG} || true && \
rm -rf /var/lib/apt/lists/*
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
RUN set -eux; \
if command -v curl >/dev/null 2>&1; then \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y; \
elif command -v wget >/dev/null 2>&1; then \
wget -qO- https://sh.rustup.rs | sh -s -- -y; \
else \
echo "ERROR: curl or wget required to install rustup"; exit 1; \
fi && \
. "$HOME/.cargo/env" && \
chmod +x ebook2audiobook.sh && \
./ebook2audiobook.sh --script_mode build_docker --docker_device "${DOCKER_DEVICE_STR}"
@@ -53,7 +60,13 @@ RUN case "${DEVICE_TAG}" in \
*) ;; \
esac
ENV LD_LIBRARY_PATH=/usr/local/cuda-11.4/lib64${DEVICE_TAG#jetson51*}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
RUN if [[ "${DEVICE_TAG}" == jetson51* ]]; then \
export LD_LIBRARY_PATH="/usr/local/cuda-11.4/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}"; \
else \
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}"; \
fi && \
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> /etc/environment
ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}
RUN wget -nv "$CALIBRE_INSTALLER_URL" -O /tmp/calibre.sh && \
bash /tmp/calibre.sh && rm -f /tmp/calibre.sh