Fabrica de conexoes Java

Boa noite, estou montando em sistema com Docker, ai tenho duvida na conexao, abaixo podem ver o mysql conectando sem erros:

joaoeduardo@joaoeduardo ~ $ docker exec -it mysql1 mysql -uroot -p [ruby-2.7.1p83]
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 56
Server version: 8.0.20 MySQL Community Server - GPL
Copyright © 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
mysql>


o Mysql nativo no SO, o driver de conexao e jdbc ficaria assim:

 Connection conexao = DriverManager.getConnection(
                    "jdbc:mysql://localhost/meubanco", root, senha);

Mas no docker como ficaria a sintexe desta linha?

  Connection conexao = DriverManager.getConnection(
                    "jdbc:mysql://  < como ficaria aqui >);

Acho que o comando docker inspect <container> irá retornar o ip do container (junto com outras informações). Você pode tentar usar ele. Se não funcionar, talvez vc tenha que dá uma lida em como configurar uma rede no docker.