The dockerfile is here . It's nothing special, just lots of packages on base ubuntu.
To add to what's been said: our approach is the batteries included approach and it's optimized for developer/sysadmin productivity (as opposed to saving disk space). When we open a web terminal, we want all the common tools across all apps (ping, nc, telnet, tar, node, php, python what have you). The Web terminal and File manager have a bunch of tooling prerequisites - tar, zip, rar, jq, database clients (mysql/postgres/redis/mongo), etc for it work well.
Any image will work including multi-stage builds. You have to pay attention to our deployment paradim though - https://docs.cloudron.io/packaging/cheat-sheet/#filesystem . Containers are run on a readonly fs, there is no way around this.