How to automate the setup when use separated mysql (or any db)?

I’m trying to use AWS RDS Aurora (MySQL)
It seems that I need to run temporal-sql-tool manually. GitHub - temporalio/helm-charts: Temporal Helm charts
I wonder how to automate this properly?
I will use a fixed temporal docker image version, so how to make sure I get the right version of schema and tool? I need to git clone the repo with a specific tag? Or is this tool and schema it uses in the docker image already?
Lastly, I’m providing admin credential to temporal docker image, why not have this automatically setup when temporal service start for the first time?

Thank you very much!

try this: Docker Hub

How do I run this? I tried the following and none works
docker run -it --rm temporalio/admin-tools:1.7.0 bash
docker run -it --rm temporalio/admin-tools:1.7.0 sh
docker run -it --rm temporalio/admin-tools:1.7.0 /bin/bash

I figured it out, I have to run it in background then exec to it

docker run -d temporalio/admin-tools:1.7.0
docker exec -it 9b7e04a04ab4 bash

@Wenquan_Xing
No I did not figure out anything
I need to automate this
I tried
docker run --rm temporalio/admin-tools:1.7.0 /usr/local/bin/temporal-sql-tool
But the output is really strange
Something is wrong with this docker image

If I have to run it in the background then use exec to connect to it then there is no way to automate it

The entry point of the docker image is set to
“Entrypoint”: [“tail”,"-f","/dev/null"]
So it is not possible to run other commands
This docker image is meant to run forever
We need a different docker image in order to do just run temporal-sql-tool just once

Also my other question: why do we have to do this at all? Can’t this be part of the bootstrap?

I found this command works
docker run --rm --entrypoint=’’ temporalio/admin-tools:1.7.0 temporal-sql-tool

I should not have spammed the thread. Sorry

docker run --entrypoint "/usr/local/bin/temporal-sql-tool" temporalio/admin-tools:1.7.0 -ep host.docker.internal -u temporal --pw temporal create --db temporal

docker run --entrypoint "/usr/local/bin/temporal-sql-tool" temporalio/admin-tools:1.7.0 -ep host.docker.internal -u temporal --pw temporal --db temporal setup-schema -v 0.0

docker run --entrypoint "/usr/local/bin/temporal-sql-tool" temporalio/admin-tools:1.7.0 -ep host.docker.internal -u temporal --pw temporal --db temporal update-schema -d ./schema/mysql/v57/temporal/versioned

docker run --entrypoint "/usr/local/bin/temporal-sql-tool" temporalio/admin-tools:1.7.0 -ep host.docker.internal -u temporal --pw temporal create --db temporal_visibility

docker run --entrypoint "/usr/local/bin/temporal-sql-tool" temporalio/admin-tools:1.7.0 -ep host.docker.internal -u temporal --pw temporal --db temporal_visibility setup-schema -v 0.0

docker run --entrypoint "/usr/local/bin/temporal-sql-tool" temporalio/admin-tools:1.7.0 -ep host.docker.internal -u temporal --pw temporal --db temporal_visibility update-schema -d ./schema/mysql/v57/visibility/versioned

I got this error
error creating database:Error 1193: Unknown system variable ‘transaction_isolation’

I need to add --ca tx_isolation=READ-COMMITTED