Ray cluster with docker images from AWS ECR

Hello,
i am using ray version 2.38.0
i am trying to use a ray cluster but with docker images from AWS ECR repository
in order to pull this images i need to provide certain credentials first
in other words i need to execute command
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin .dkr.ecr.us-east-1.amazonaws.com
before docker pull or docker run

in my experiments commands from “head_setup_commands:” are being executed after an attempt to pull/run a docker from “docker” yaml file section, so the cluster deployment is failed

the only workaround that comes into my mind is to prepare an ami where ECR login command is added to bash_profile and executed upon the start.

Is there a more straightforward solution?

cc @Kai-Hsun_Chen for this kuberay issue