SSH connection refusing while connecting gitlab runner to fargat

I am trying to run my gitlab jobs to fargat . But at the time of running it gives an error of ssh connection refused {no public key}
I want to configure my docker image that can take an environmental variable as an ssh_public_key dynamically from the farget driver.
I need help that how to prepare the docker image that takes dynamically public key from the fargat driver