Local dev of Cloud Run Job – keeps restarting

Hi,
I am developing a cloud run job locally and using gcloud beta code dev --dockerfile to test the job. However, it seems once the container is run it is running as a ‘service’ not a ‘job’ and keeps restarting, even when it is still executing its current tasks. – This restart behaviour is seperate to the rebuild and run on save functionality.

Is there a way to set this behaviour to run as a job and complete execution of the container once?
– Thanks :folded_hands:

Hi John2,

The gcloud beta code dev command is used to run a Cloud Run service in a local development environment. This is why, once the container runs, it behaves as expected as a service and not a job.

Currently, there is no official emulator or local development environment for Cloud Run jobs. You might find this relevant Stack Overflow discussion helpful. Additionally, you can file a feature request for this functionality to bring it to Google’s attention but there is no timeline on when it can be done.