-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Search depended packages by path suffix #858
Conversation
Package search by substring finds the substring in libc6-dev package in bookworm causing dev packages to be installed in the slim image. Fixes docker-library#857.
I verified what changed due to this commit:
|
LGTM $ docker run -it --rm python:slim bash
root@097ad189d1b7:/# diff -u \
<(find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' 2>/dev/null | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "%s\n", so }' | sort -u | xargs -r dpkg-query --search | cut -d: -f1 | sort -u) \
<(find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' 2>/dev/null | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' | sort -u | xargs -r dpkg-query --search | cut -d: -f1 | sort -u)
--- /dev/fd/63 2023-08-25 21:01:29.769054925 +0000
+++ /dev/fd/62 2023-08-25 21:01:29.769054925 +0000
@@ -1,6 +1,5 @@
libbz2-1.0
libc6
-libc6-dev
libcom-err2
libcrypt1
libdb5.3 |
Thank you! |
Changes: - docker-library/python@81b6e5f: Merge pull request docker-library/python#858 from kohtala/issue-857 - docker-library/python@2a443de: Update 3.9 to 3.9.18 - docker-library/python@3baa203: Update 3.8 to 3.8.18 - docker-library/python@ffc9b5b: Update 3.11 to 3.11.5, pip 23.2.1 - docker-library/python@9102bda: Update 3.10 to 3.10.13
Thank you. I realize it would have been helpful, had I noticed to include the quote already in the comments. Sorry for that. |
For my own future reference, the specific offending file path is this one:
😮💨 Edit: a more clear/complete example: $ docker run -it --rm python:3.11.4-slim bash
root@1b9dc2995f40:/# dpkg-query --search lib/x86_64-linux-gnu/libc.so.6
libc6-dev:amd64: /usr/share/gdb/auto-load/lib/x86_64-linux-gnu/libc.so.6-gdb.py
libc6:amd64: /lib/x86_64-linux-gnu/libc.so.6 |
Package search by substring finds the substring in libc6-dev package in bookworm causing dev packages to be installed in the slim image.
Fixes #857.