Update base for RT running in a docker container

I have RT 4.4.4 running in a docker container and want to update the version to 5.0.1 and the database which is running in a mysql image in another container. The update-database script wants to connect to mysql using the mysqld socket which doesn’t work across containers, at least not that I can see. Is there any way to make upgrade database connect over tcp to a remote host instead of via the socket?