cadreader (0.8.10)

Published 2026-11-21 19:50:28 +08:00 by kakan

Installation

docker pull git.wun.im/kakan/cadreader:0.8.10
sha256:f2613bafde4547e9ac4d687a12d6a76705f73a99b5bf8f0f05907bf08f48ed25

Images

Digest OS / Arch Size
572679ee94 linux/amd64 546 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"]
umoci repack
Install source-bound CadReader wheel, paired Skill and native probe
Install 0.8.7 CadReader wheel and paired Skill over exact 0.8.6 release layers
Install 0.8.9 CadReader wheel and paired Skill over exact 0.8.7 release layers
ARG CADREADER_VERSION=0.8.10
ARG CADREADER_COMMIT=9e72c910b578fad70797c99411ea906e62fad8d5
ARG SKILL_COMMIT=6038236c3284ab70d0feb6921143ae460770e763
USER root
WORKDIR /app
LABEL org.opencontainers.image.version=0.8.10 org.opencontainers.image.revision=9e72c910b578fad70797c99411ea906e62fad8d5 io.cadreader.skill.revision=6038236c3284ab70d0feb6921143ae460770e763
RUN |3 CADREADER_VERSION=0.8.10 CADREADER_COMMIT=9e72c910b578fad70797c99411ea906e62fad8d5 SKILL_COMMIT=6038236c3284ab70d0feb6921143ae460770e763 /bin/sh -c rm -rf /app/src /app/skills/cad-takeoff /app/contracts/semantic-assist/v1 /app/deploy/v01 # buildkit
COPY pyproject.toml README.md ./ # buildkit
COPY src/ ./src/ # buildkit
COPY deploy/v01/ ./deploy/v01/ # buildkit
COPY contracts/semantic-assist/v1/ ./contracts/semantic-assist/v1/ # buildkit
COPY skills/cad-takeoff/ ./skills/cad-takeoff/ # buildkit
COPY wheel/ /private-wheel/ # buildkit
COPY tools/paired_build_context.py /tmp/paired_build_context.py # buildkit
RUN |3 CADREADER_VERSION=0.8.10 CADREADER_COMMIT=9e72c910b578fad70797c99411ea906e62fad8d5 SKILL_COMMIT=6038236c3284ab70d0feb6921143ae460770e763 /bin/sh -c set -eu; printf '%s %s\n' bda7c79a901be17d4e0a76ea6e9dfddb24b83601e98cf41d66c158a9c428ca24 /app/oda/ODAFileConverter 385bf4f1642651437fb370759250c8d6ceaf2ca3febdb53eb5f3d5470b34a205 /app/oda/plugins/platforms/libqminimal.so | sha256sum -c -; cd /usr/local/lib/cadreader-native/probe; sha256sum -c SHA256SUMS; cd /app; python -m pip install --no-index --no-deps --no-cache-dir --force-reinstall "/private-wheel/cadreader_mcp-${CADREADER_VERSION}-py3-none-any.whl"; rm -rf /private-wheel; python /tmp/paired_build_context.py --check-image /app; rm /tmp/paired_build_context.py # buildkit
USER 10001:10001
RUN |3 CADREADER_VERSION=0.8.10 CADREADER_COMMIT=9e72c910b578fad70797c99411ea906e62fad8d5 SKILL_COMMIT=6038236c3284ab70d0feb6921143ae460770e763 /bin/sh -c python /app/deploy/v01/verify_image_files.py --native-reader && python -c 'import sys; from cadreader import __version__; assert __version__ == sys.argv[1]' "$CADREADER_VERSION" # buildkit

Labels

Key Value
io.cadreader.database-schema 3
io.cadreader.private.oda.version 27.10.0.0
io.cadreader.skill.revision 6038236c3284ab70d0feb6921143ae460770e763
org.opencontainers.image.revision 9e72c910b578fad70797c99411ea906e62fad8d5
org.opencontainers.image.version 0.8.10
Details
Container
2026-11-21 19:50:28 +08:00
0
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