I have a Dockerfile with a sequence of RUN instructions that execute \"apt-get install\"s; for example, a couple of lines:
RUN apt-get install -y tree RUN apt-ge
Have a look at:
https://github.com/moul/docker-diff
They list Brew install instructions for Mac, I'm assuming it's a Bash script, so I assume it could be made to work in other *nix environments.
Brew