failed to fetch an image or build from source: image must be amd64 architecture for linux os, found arm64 linux

Hi, I’m getting an error when I try to deploy my app:

gerardmartinezalcocer@MacBook-Pro-de-Gerard ~ % fly deploy

==> Verifying app config

Validating /Users/gerardmartinezalcocer/fly.toml

Platform: machines

✓ Configuration is valid

→ Verified app config

==> Building image

Searching for image ‘gerardm5/libreta.jar:0.0.1’ remotely…

Error: failed to fetch an image or build from source: image must be amd64 architecture for linux os, found arm64 linux

I have a Macbook Pro M3,

In the fly.toml i have this:

app = “track-up”
primary_region = “mad”

[http_service]
internal_port = 8080
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
processes = [“app”]

[[vm]]
cpu_kind = “shared”
cpus = 1
memory_mb = 256

[build]
image = “gerardm5/libreta.jar:0.0.1”

Can you help me?

Hi @GerardM5!

I see in Docker Hub that gerardm5/libreta.jar:0.0.1 is already a linux/amd64 image. However, did you initially push/try to deploy a linux/arm64 image with the same tag?

If so, then we may have cached the gerardm5/libreta.jar:0.0.1 image reference as an arm64 image. The simplest thing to try would be to push the amd64 image to a new tag and to deploy the new tag instead. Using :latest may also work, since it will avoid the cache.

(If you really need to use the :0.0.1 tag, then I could also ask internally about manually checking/clearing the cache.)

Fly seems to consider the image arm64:

$ fly console --image gerardm5/libreta.jar:0.0.1
Searching for image 'gerardm5/libreta.jar:0.0.1' remotely...
Error: failed to get image: image must be amd64 architecture for linux os, found arm64 linux

How was this image build and published? I’m wondering if it was build on a M3 mac (arm64) but somehow mislabeled as amd64.

This works:

fly console --image registry.docker.com/gerardm5/libreta.jar:0.0.1 

Try either republishing (as Matthew suggests) or fully qualifying the image name (bypassing our cache).

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