There are different methods to authenticate to artifact registry. Since you prefer using temporary credentials, you can try using a short-lived OAuth access token for password authentication. However, keyrings.google-artifactregistry-auth
relies on ADC or json credentials so the access token should follow a specific json file format.
As for AR authentication during docker build time, it is best practice to generate the access token using gcloud print-access–token
before performing docker build.
I came across this StackOverflow post about injecting credentials to docker build. You can follow the suggestions made in the thread and see if those would help.