I try to build a docker image for my raspberry pi 4b which supports 64bits arch, but OS installed is 32bits (I can’t change it).
uname -a
Linux raspberrypi 6.1.32-v8+ #1656 SMP PREEMPT Wed Jun 7 11:37:17 BST 2023 aarch64 GNU/Linux
getconf LONG_BIT
32
I build the images on Windows 10 using desktop-linux builder.
docker buildx inspect
Name: desktop-linux
Driver: docker
Last Activity: 2024-08-19 11:26:09 +0000 UTC
Nodes:
Name: desktop-linux
Endpoint: desktop-linux
Status: running
BuildKit version: v0.13.2
Platforms: linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64,
linux/arm/v7, linux/arm/v6
Dockerfile
# FROM --platform=$BUILDPLATFORM alpine:3.18
# FROM arm32v7/alpine:3.18 #prolly the same as next line
FROM --platform=linux/arm/v7 alpine:3.18
# FROM --platform=linux/arm64 alpine:3.18
[...]
# Set the default entry point to run the Node.js application
ENTRYPOINT ["node", "dist/index.js"]
# Additional CMD to start Bash if needed
CMD ["/bin/bash"]
My private docker repo (192.168.8.x:) works ok (tested with other images)
docker buildx build -t 192.168.8.x:<port>/myapp1:v100 --push .
# I add --platform linux/xxx when using $BUILDPLATFORM
docker-compose.yml on the raspberry
version: '3'
services:
myapp1:
#platform: linux/arm64
container_name: myapp1
image: 192.168.8.x:<port>/myapp1:v100
ports:
- "3000:3000"
restart: always
myapp2:
#platform: linux/arm64
container_name: myapp2
image: 192.168.8.x:<port>/myapp2:v100
deploy:
resources:
limits:
cpus: '0.6' # Limiting to 60% CPU usage
environment:
MYAPP1_URL: http://myapp1:3000
restart: always
docker run <imageid> //or docker compose up -d
WARNING: The requested image's platform (linux/arm64) does not match the detected host platform (linux/arm/v8) and no specific platform was requested
In portainer I can’t get the logs as container is always restarting
I either get
No log line matching the '' filter
or
exec /usr/local/bin/docker-entrypoint.sh: exec format error
What am I missing here?
Thank you
KevinOB13 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1