cadreader (0.7.2)

Published 2026-11-15 00:04:51 +08:00 by kakan

Installation

docker pull git.wun.im/kakan/cadreader:0.7.2
sha256:a1e0897b679dfc1d5cceaa85324ac2d92c784f8eb01532a4adfb45bbca223162

Images

Digest OS / Arch Size
6a0cd94ae4 linux/amd64 294 MiB

Image Layers ( linux/amd64)

# debian.sh --arch 'amd64' out/ 'bookworm' '@1793827419'
ENV PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ENV LANG=C.UTF-8
RUN /bin/sh -c set -eux; apt-get update; apt-get install -y --no-install-recommends ca-certificates netbase tzdata ; rm -rf /var/lib/apt/lists/* # buildkit
ENV GPG_KEY=7169605F62C751356D054A26A821E680E5FA6305
ENV PYTHON_VERSION=3.12.16
ENV PYTHON_SHA256=b5796915dc45ff745cfb4e990a7e7c93d6f546328a102ce31448d69ebc37575c
RUN /bin/sh -c set -eux; savedAptMark="$(apt-mark showmanual)"; apt-get update; apt-get install -y --no-install-recommends dpkg-dev g++ gcc gnupg libbluetooth-dev libbz2-dev libc6-dev libdb-dev libffi-dev libgdbm-dev liblzma-dev libncursesw5-dev libreadline-dev libsqlite3-dev libssl-dev make tk-dev uuid-dev wget xz-utils zlib1g-dev ; wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; echo "$PYTHON_SHA256 *python.tar.xz" | sha256sum -c -; wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc"; GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$GPG_KEY"; gpg --batch --verify python.tar.xz.asc python.tar.xz; gpgconf --kill all; rm -rf "$GNUPGHOME" python.tar.xz.asc; mkdir -p /usr/src/python; tar --extract --directory /usr/src/python --strip-components=1 --file python.tar.xz; rm python.tar.xz; cd /usr/src/python; gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; ./configure --build="$gnuArch" --enable-loadable-sqlite-extensions --enable-optimizations --enable-option-checking=fatal --enable-shared $(test "${gnuArch%%-*}" != 'riscv64' && echo '--with-lto') --with-ensurepip ; nproc="$(nproc)"; EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)"; LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"; LDFLAGS="${LDFLAGS:-} -Wl,--strip-all"; arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; case "$arch" in amd64|arm64) EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"; ;; i386) ;; *) EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer"; ;; esac; make -j "$nproc" "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" "LDFLAGS=${LDFLAGS:-}" ; rm python; make -j "$nproc" "EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" "LDFLAGS=${LDFLAGS:-} -Wl,-rpath='\$\$ORIGIN/../lib'" python ; make install; cd /; rm -rf /usr/src/python; find /usr/local -depth \( \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) -o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name 'libpython*.a' \) \) \) -exec rm -rf '{}' + ; ldconfig; apt-mark auto '.*' > /dev/null; apt-mark manual $savedAptMark; find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' | sort -u | xargs -rt dpkg-query --search | awk 'sub(":$", "", $1) { print $1 }' | sort -u | xargs -r apt-mark manual ; apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; rm -rf /var/lib/apt/lists/*; export PYTHONDONTWRITEBYTECODE=1; python3 --version; pip3 --version # buildkit
RUN /bin/sh -c set -eux; for src in idle3 pip3 pydoc3 python3 python3-config; do dst="$(echo "$src" | tr -d 3)"; [ -s "/usr/local/bin/$src" ]; [ ! -e "/usr/local/bin/$dst" ]; ln -svT "$src" "/usr/local/bin/$dst"; done # buildkit
CMD ["python3"]
LABEL io.cadreader.database-schema=3
LABEL org.opencontainers.image.version=0.7.2
ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 CADREADER_STORAGE_DIR=/storage CADREADER_SOURCE_DIR=/sources
RUN /bin/sh -c groupadd --gid 10001 cadreader && useradd --uid 10001 --gid cadreader --home-dir /nonexistent --shell /usr/sbin/nologin cadreader && install -d -o cadreader -g cadreader /storage /sources # buildkit
WORKDIR /app
COPY pyproject.toml README.md ./ # buildkit
COPY src/ ./src/ # buildkit
COPY skills/cad-takeoff/ ./skills/cad-takeoff/ # buildkit
COPY deploy/v01/ ./deploy/v01/ # buildkit
COPY deploy/constraints-050.txt ./deploy/constraints-050.txt # buildkit
COPY contracts/semantic-assist/v1/ ./contracts/semantic-assist/v1/ # buildkit
COPY tools/paired_build_context.py /tmp/cadreader-paired-build-context.py # buildkit
RUN /bin/sh -c python /tmp/cadreader-paired-build-context.py --check-image /app && rm /tmp/cadreader-paired-build-context.py # buildkit
RUN /bin/sh -c chgrp -R cadreader /app && chmod -R u=rwX,g=rX,o= /app # buildkit
ENTRYPOINT ["cadreader-mcp"]
ENV CADREADER_DWG2DXF=/usr/local/bin/dwg2dxf CADREADER_VIEW_FONT_PATH=/usr/share/fonts/truetype/wqy/wqy-zenhei.ttc MPLCONFIGDIR=/storage/cache/matplotlib XDG_CACHE_HOME=/storage/cache OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 MKL_NUM_THREADS=1 NUMEXPR_NUM_THREADS=1
RUN /bin/sh -c apt-get update && apt-get install -y --no-install-recommends libxml2 libreadline8 zlib1g libseccomp2 fonts-noto-cjk fonts-wqy-zenhei fonts-dejavu-core poppler-utils && rm -rf /var/lib/apt/lists/* # buildkit
COPY /usr/local/bin/dwg2dxf /usr/local/bin/dwg2dxf # buildkit
COPY /usr/local/bin/dwgread /usr/local/bin/dwgread # buildkit
COPY /usr/local/lib/libredwg.so* /usr/local/lib/ # buildkit
COPY /usr/local/share/licenses/libredwg/ /usr/local/share/licenses/libredwg/ # buildkit
RUN /bin/sh -c ldconfig && pip install --no-cache-dir -c deploy/constraints-050.txt '.[worker]' # buildkit
USER 10001:10001
RUN /bin/sh -c python /app/deploy/v01/verify_image_files.py # buildkit
HEALTHCHECK {Test:[CMD python /app/deploy/v01/health.py --role worker] Interval:30s Timeout:5s StartPeriod:30s StartInterval:0s Retries:3}
CMD ["--role" "worker"]
USER root
ARG CADREADER_VERSION=0.7.2
COPY /native/ /usr/local/lib/cadreader-native/ # buildkit
ENV CADREADER_NATIVE_READER_BUNDLED=1 DOTNET_EnableDiagnostics=0 DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1 DOTNET_GCHeapHardLimit=A0000000
RUN |1 CADREADER_VERSION=0.7.2 /bin/sh -c apt-get update && apt-get install -y --no-install-recommends libgssapi-krb5-2 libssl3 && rm -rf /var/lib/apt/lists/* # buildkit
RUN |1 CADREADER_VERSION=0.7.2 /bin/sh -c python -c "import os,tomllib; assert os.environ['CADREADER_VERSION'] == tomllib.load(open('pyproject.toml','rb'))['project']['version'], 'Pass the source version as CADREADER_VERSION'" && pip install --no-cache-dir -c deploy/constraints-050.txt '.[inference]' # buildkit
LABEL org.opencontainers.image.version=0.7.2
USER 10001:10001
RUN |1 CADREADER_VERSION=0.7.2 /bin/sh -c python /app/deploy/v01/verify_image_files.py --native-reader # buildkit
EXPOSE [8000/tcp]
HEALTHCHECK {Test:[CMD python /app/deploy/v01/health.py --role api] Interval:30s Timeout:5s StartPeriod:30s StartInterval:0s Retries:3}
CMD ["--role" "api" "--host" "0.0.0.0" "--port" "8000"]

Labels

Key Value
io.cadreader.database-schema 3
org.opencontainers.image.version 0.7.2
Details
Container
2026-11-15 00:04:51 +08:00
3
OCI / Docker
Versions (9) View all
0.8.10 2026-11-21
0.8.9 2026-11-21
0.8.7 2026-11-21
0.7.2 2026-11-15
0.7.1 2026-11-14