"exec format error" when trying to start a arm64 docker image on Raspberry Pi with 64 bit Kernel

I am attempting to run a arm64 docker image:
https://hub.docker.com/r/florider89/joplin-server/tags

on a Raspberry Pi 4 with a 64 bit Debian Kernel:

$ uname -a
Linux raspberrypi 5.10.92-v8+ #1514 SMP PREEMPT Mon Jan 17 17:39:38 GMT 2022 `aarch64` GNU/Linux

using Docker version:

$ docker -v
Docker version 20.10.12, build e91ed57

When I run

$ docker-compose up

I get an error repeated many times:

Starting user_db_1 ... done
Starting user_app_1 ... done
Attaching to user_db_1, user_app_1
app_1  | standard_init_linux.go:228: exec user process caused: exec format error
db_1   | 
db_1   | PostgreSQL Database directory appears to contain a database; Skipping initialization
db_1   | 
db_1   | 2022-02-09 18:11:00.278 UTC [1] LOG:  starting PostgreSQL 13.1 (Debian 13.1-1.pgdg100+1) on aarch64-unknown-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
db_1   | 2022-02-09 18:11:00.278 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
db_1   | 2022-02-09 18:11:00.279 UTC [1] LOG:  listening on IPv6 address "::", port 5432
db_1   | 2022-02-09 18:11:00.313 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db_1   | 2022-02-09 18:11:00.360 UTC [28] LOG:  database system was shut down at 2022-02-09 17:49:35 UTC
db_1   | 2022-02-09 18:11:00.387 UTC [1] LOG:  database system is ready to accept connections
user_app_1 exited with code 1
app_1  | standard_init_linux.go:228: exec user process caused: exec format error
... repeated many times
user_app_1 exited with code 1
app_1  | standard_init_linux.go:228: exec user process caused: exec format error
...
user_app_1 exited with code 1
app_1  | standard_init_linux.go:228: exec user process caused: exec format error
...
user_app_1 exited with code 1
..
user_app_1 exited with code 1
app_1  | standard_init_linux.go:228: exec user process caused: exec format error
..
user_app_1 exited with code 1
app_1  | standard_init_linux.go:228: exec user process caused: exec format error
...
user_app_1 exited with code 1
app_1  | standard_init_linux.go:228: exec user process caused: exec format error
...
user_app_1 exited with code 1
app_1  | standard_init_linux.go:228: exec user process caused: exec format error
....

This will keep going until I Ctrl+C to stop the process:

^CGracefully stopping... (press Ctrl+C again to force)
Stopping user_app_1 ... done
Stopping user_db_1  ... done

I found a few thread describing this error as the result of an image and system architecture mismatch however I am running an arm64 image on a 64 bit system.

This is my first attempt at running a docker application and the error doesn’t appear to be very helpful. Any insight into what I am doing wrong?

Hi,
the times that I’ve had these errors is when the container that’s been pulled has had the wrong architecture - trying to use amd64 on a pi.

You might try docker manifest inspect --verbose user_app_1 and see what os/arch it thinks you’ve go.

(grasping at straws here)