@Rasmikant Bal I assume you have already configured Docker, and APIs and looking for options to automate self-hosted gateway steps described in Deploy an Azure API Management self-hosted gateway to Docker. Unfortunately, we don't have any guidelines/doc or tools specifically on automating this process.
My suggestion is to explore more on tools such as Azure Pipelines or GitHub Actions. Let's take Azure Pipelines as an example. I am not a DevOps expert and from the docs, I see you can Invoke REST API v1 task for calling Rest APIs and Docker v2 task for running docker command.
To generate access token for Self-Hosted Gateway, first you need to set up App registration in Azure AD with client credential flow (refer doc), generate token from AD endpoint to access APIM endpoint and then call Gateway - Generate Token Rest API with AD token. Then depends on how docker container authentication/authorization is set up, you can manage access to Docker via pipeline and call Docker task to deploy self-hosted gateway.
For any questions specific to DevOps, please feel free to reach out to dedicated forum [https://techcommunity.microsoft.com/t5/azure-devops/bd-p/AzureDevOpsForum (DevOps is not yet supported in Q&A) for assistance.
Please let me know if I can help you with any other questions.