I can the image ref of one of my apps to deploy a totally different app. Somehow fly finds the image and uses it. But while create a machine with that ref, it says it can not find the image.
Latest was just a dummy image tag because by default flyctl adds a timestamp to the image tag. My point is that same image works with fly deploy but not with fly machine run or using the machine api
Hi @JP_Phillips I run it in a directory with the fly.toml so it automatically picks the app from there. BUt ideally I want to do this from the Machines API and that doesn’t work either.
no. it’s scoped to my account. I created it from the dashboard. AFAIK token created from the dashboard are scoped to my account, and so can access every org I belong to.
when I run fly deploy --build-only, doesn’t it push the image to the registry?
I think I’m now able to narrow it down to the fact that the --build-only flag doesn’t save the image in the registry. I have the following apps
cronatlas-nodejs-alpine
restless-resonance-7989
I did a fly deploy for cronatlas-nodejs-alpine app which resulted in a deployment that created machines with the following image. registry.fly.io/cronatlas-nodejs-alpine:deployment-01HMY71DG6ZDNHZ6J1BPSGHRH1
Then fly deploy --remote-only --dockerfile Dockerfile.alpine --app cronatlas-nodejs-alpine --build-only which resulted in a new image
This command works because it’s using the image tag for the one that was generated when I deployed: fly machine run --org cron-atlas registry.fly.io/cronatlas-nodejs-alpine:deployment-01HMY71DG6ZDNHZ6J1BPSGHRH1 --app restless-resonance-7989 --rm
Thiis one doesn’t because it’s using the image generated from the deploy with a --build-only flag: fly machine run --org cron-atlas registry.fly.io/cronatlas-nodejs-alpine:deployment-01HMY7Y7KWS90E94VYNN05AADM --app restless-resonance-7989 --rm
It shows the error:
Searching for image 'registry.fly.io/cronatlas-nodejs-alpine:deployment-01HMY7Y7KWS90E94VYNN05AADM' remotely...
Error: Could not find image "registry.fly.io/cronatlas-nodejs-alpine:deployment-01HMY7Y7KWS90E94VYNN05AADM"
So fly deploy with --build-only flag doesn’t push to the registry.