Could not find image error when trying to start a new machine using machines API

Hello,

I’ve deployed my app using the following command in the terminal:

fly deploy --build-only --image-label myapp

Everything went smoothly, and I received this success message:

--> Building image done
image: registry.fly.io/myapp:myapp
image size: 764 MB

However, when I tried to create a new machine using the command below:

fly machines run registry.fly.io/myapp:myapp

I got the following error:

Searching for image 'registry.fly.io/myapp:myapp' remotely...
Error: Could not find image "registry.fly.io/myapp:myapp"

Can anyone help me resolve this issue?

Kind regards,

Gustavo

The normal way to do it is to use flyctl deploy; try dropping the --build-only flag.

1 Like

Hey, thanks for your help! So, in my case, these machines are started by another app through the REST API whenever needed, and I was trying to mimic that behavior using the CLI. Any idea how I could do that?

Ah, gotcha. I’m doing similar in my app, though I am using the API. I’d go with:

  • Normal flyctl deploy to ensure it works at the app level
  • flyctl scale count 0 to remove running machines
  • Then flyctl machine start when you want a machine
1 Like

Just to augment @halfer’s answer a little:

(The flags for fly deploy around this have always been a little confusing…)

1 Like

That’s it! Much thanks!

1 Like

Ah, I forgot I did this already:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.