cd /news/developer-tools/como-solucionar-docker-run-con-exit-… · home topics developer-tools article
[ARTICLE · art-11926] src=dev.to ↗ pub= topic=developer-tools verified=true sentiment=· neutral

Cómo solucionar `docker run` con exit code 1 en Raspberry Pi

The article explains that a `docker run` command resulting in exit code 1 on a physical Raspberry Pi is often caused by an architecture mismatch (e.g., running an amd64 image on an ARM system) or a syntax error in the command, such as spaces around the `=` in `--net = host`. It recommends verifying the architecture with `uname -m` and `docker inspect`, installing QEMU for multi-architecture support, and using `docker buildx` to build images specifically for ARM platforms to prevent the error.

read2 min views23 publishedMay 23, 2026

docker run con exit code 1 en Raspberry Pi El error Exited (1) indica que el proceso principal del contenedor terminó con un código de salida no cero —es decir, falló. El hecho de que funcione en una VM de Raspberry Pi pero no en el hardware físico apunta a una diferencia en el entorno de ejecución. Las causas más comunes en Raspberry Pi son: amd64 (x86_64) y se intenta ejecutar en ARM (armv7l o aarch64 ).binfmt_misc configurado, Docker no puede ejecutar binarios de otra arquitectura.docker run

: El espacio en --net = host
(con espacios alrededor del =

) es un error de sintaxis que no siempre es detectado por Docker, pero puede causar comportamientos erráticos.# Arquitectura del Raspberry Pi (hardware físico) uname -m docker inspect myimage --format '{{.Architecture}}' Si uname -m muestra armv7l o aarch64 , y la imagen reporta amd64 , la arquitectura no coincide. docker run

El comando original tiene un error grave: --net = host
(espacios alrededor del =
). Docker interpreta =

como parte del valor del flag, lo que puede causar fallos silenciosos o errores de parseo. ✅ Comando corregido: docker run --net=host -d -t myimage ⚠️ Nota crítica: En versiones recientes de Docker, --net=host no funciona en contenedores no Linux (como en Raspberry Pi conarmhf ), y puede causar fallos si el kernel no lo soporta. Si el contenedor no necesita acceso directo a la red del host, usa--net=bridge . docker run --net=host -it --rm myimage Elimina -d (background) y añade-it para ver logs en tiempo real y capturar errores. Instala soporte multiarquitectura:

sudo apt update && sudo apt install -y qemu-user-static binfmt-support
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes

Luego ejecuta de nuevo tu contenedor. docker ps -a # Encuentra el ID del contenedor con Exited (1) docker logs <container_id> uname -m

docker inspect myimage --format '{{.Architecture}}'
docker run --net=host -it --rm myimage
sudo apt update && sudo apt install -y qemu-user-static binfmt-support
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker run --net=host -d -t myimage

Si controlas la construcción de la imagen, nunca uses imágenes amd64 en Raspberry Pi. Usa:

FROM --platform=linux/arm/v7 raspbian/stretch
FROM --platform=linux/arm64 ubuntu:22.04

Y construye con: docker build --platform linux/arm/v7 -t myimage . ✅ Consejo definitivo: Usa docker buildx para construir multiarquitectura: docker buildx build --platform linux/arm/v7,linux/arm64 -t myimage . Esto evita 99% de los errores de Exited (1) en Raspberry Pi. Si te sirvió esta ayuda, suscríbete para recibir los errores más comunes de la semana y cómo evitarlos. 👉 Suscríbete aquí

── more in #developer-tools 4 stories · sorted by recency
── more on @docker 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/como-solucionar-dock…] indexed:0 read:2min 2026-05-23 ·