This line https://github.com/docker-library/ruby/blob/e040029c82501556371e9d84a9db607dfb1bba51/Dockerfile-slim.template#L101-L102 won't work as expected. Because of the `!` it will always succeed. Shellcheck tracks this behavior with ```bash ! dpkg -l | grep -i ruby ^-- SC2251: This ! is not on a condition and skips errexit. Use `&& exit 1` instead, or make sure $? is checked. ``` I can't see a clean one-liner to solve this, I think the correct way is to rather run: `if dpkg -l | grep -i 'ruby'; then return 1; fi` also `dpkg -l` can list previously uninstalled packages, to verify a package is actually installed it would rather be `| grep -iP '^ii.*ruby.*'`