You can install binaries (especially those that build their binaries and embed it to docker image) via COPY --from
command. Here’s an example for Composer:
#...
## Install composer
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer
#...