A Dockerfile for Composer (a dependency manager for PHP)
In the wrapper script,
I don't understand why you need to loop over each argument.
Wouldn't it be enough to use a case "$1" in ... without looping at all?

If you really do need to loop,
for example to make it work even if the command you want to match is not in the first position sometimes,
then I think you want to break out of the loop after finding a match. That is:

# Loop over each argument.
for argument in "$@"; do
    case "$argument" in
        # Append the argument if the command matches one we need to use `--ignore-platform-reqs` with.
        # Found using the following search: https://github.com/composer/composer/search?q=ignore-platform-reqs+path%3Asrc%2FComposer%2FCommand%2F
        # Uses `set` to update the arguments, see https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html.
        create-project|install|remove|require|update) set -- --ignore-platform-reqs "$@"
        break
        ;;

        # Otherwise just pass it on.
        *) ;;
    esac
done


Another small thing,
at the top of the Dockerfile,
I find the echo ... &gt;&gt; /etc/apk/repositories &amp;&amp; apk add ... a bit curious.
Under what circumstances might that appending with echo fail?
And why not check the exit code of the other commands that follow?
It seems that either all commands should be chained with &amp;&amp;, or none of them.

Lastly, I have very minimal experience with Docker,
but I'm wondering if instead of multiple RUN commands,
wouldn't it be better to put them in a single shell script,
and RUN that script instead.
(That's not a recommendation, just a general wondering...)