Accessing External MySQL DB inside Keycloak Docker Container

I’m trying to access a remote DB inside Keycloak docker container with the following command:

docker run -p 8080:8080 -e DB_VENDOR=mysql -e -e DB_PORT=3306 -e DB_DATABASE=keycloak -e DB_USER=keycloak -e DB_PASSWORD=keycloak jboss/keycloak

When I run the command it raises an error:
Caused by: java.sql.SQLException: Access denied for user 'keycloak'@'' (using password: YES)

Notice that is not the IP written at DB_ADDR. I don’t know why the container accesses the DB using this IP.

So what do you think the problem is?