Skip to content

Commit

Permalink
Add pwck, grpck, ldd checks to Debian base image
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Bargull <[email protected]>
  • Loading branch information
mbargull committed Oct 16, 2023
1 parent 8846fa2 commit a783cac
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions images/base-glibc-debian-bash/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,26 @@ RUN [ ! -f /etc/apt/sources.list ] || sed --in-place= --regexp-extended \
-mindepth 1 -depth \
-delete

RUN while IFS=: read _ _ uid gid _ home _ ; do \
[ -n "${home##/var/run/*}" ] || home="${home#/var}" \
&& \
[ -d "./${home#/}" ] || [ "${home}" = "/nonexistent" ] && continue ; \
mkdir -p "./${home#/}" \
&& \
chown "${uid}:${gid}" "./${home#/}" \
&& \
chmod 775 "./${home#/}" \
; done < ./etc/passwd \
&& \
pwck --read-only --root "$( pwd )" \
| { ! grep -v -e 'no changes' -e '/nonexistent' ; } \
&& \
grpck --read-only --root "$( pwd )" \
&& \
find -xdev -type f \
| xargs chroot . ldd 2> /dev/null -- \
| sed -n '/:/h; /not found/{x;p;x;p}' | { ! grep . ; }

# Bash 4.* did not have default key bindings for control-arrow-key key
# combinations. Add some for convenience:
RUN >> /etc/inputrc \
Expand Down

0 comments on commit a783cac

Please sign in to comment.