I am trying to remotely build an image and push it to fly.io registry like so:
flyctl deploy --build-only --remote-only --no-cache --push --image registry.fly.io/APPNAME --image-label latest -a APPNAME --verbose
What i get back is
Error: failed to fetch an image or build from source: image must be amd64 architecture for linux os, found arm64 linux
Now, I did build and push to fly.io registry directly from my machine (Mac) using standard docker build and push commands. Am I stuck now?
rubys
April 1, 2024, 4:32pm
3
You are not stuck, but it looks like your Dockerfile specified arm64? Can you post your Dockerfile (or at least your FROM lines)?
It seems you’re getting the Error: failed to fetch an image or build from source: image must be amd64 architecture for linux os, found arm64 linux
error as you’re on an M* line of mac and the base image you’re pulling from (eg: the line FROM
) does not have an arm image.
You’re going to run in to issues using the fly build CLI, so I suggest doing the below
docker build --platform=linux/amd64 registry.fly.io/appname:tag
docker push registry.fly.io/appname:tag
flyctl deploy --image registry.fly.io/appname:tag -c <config>.toml
This has worked for me
2 Likes
Sorry for the duplicates (had a technical issue). My comment on the original post - Remote docker build fails - #4 by callmephilip
system
Closed
April 9, 2024, 10:03pm
6
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.