things you execute in the script array are run in the build container. Think of building a Java software which uses jdbc to access data in a MySQL DB. Now for integration testing you need a MySQL server while for building such software you only need a JDK and e.g. Maven.
So you have one Docker image with Maven and Java for building and running tests (build container) and an arbitrary number of services (a running MySQL database server, memcached etc.) which you may access as if they were running on another host. The “hostname” (in reality the name of the linked docker container) is the same as the image name where the tag is stripped and slashes are replaced by hyphen, so a service organization/special-db would be reachable/pingable as organization-special-db from inside your build container. So the MySQL server in your example is reachable via TCP as “host” mysql at port 3306 HTH.