惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
Netflix TechBlog - Medium
大猫的无限游戏
大猫的无限游戏
B
Blog
J
Java Code Geeks
T
Tailwind CSS Blog
腾讯CDC
A
About on SuperTechFans
GbyAI
GbyAI
H
Help Net Security
IT之家
IT之家
L
LangChain Blog
Y
Y Combinator Blog
Hugging Face - Blog
Hugging Face - Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
SegmentFault 最新的问题
博客园 - 叶小钗
小众软件
小众软件
I
InfoQ
爱范儿
爱范儿
有赞技术团队
有赞技术团队
博客园 - 司徒正美
博客园 - 【当耐特】
Jina AI
Jina AI
D
Docker

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Cómo solucionar `docker run` con exit code 1 en Raspberry Pi
Erick Eduard · 2026-05-24 · via DEV Community

Erick Eduardo Ramos

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

Explicación técnica

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:

  • Arquitectura incompatible: La imagen se construyó para amd64 (x86_64) y se intenta ejecutar en ARM (armv7l o aarch64).
  • Falta de emulación QEMU: Sin binfmt_misc configurado, Docker no puede ejecutar binarios de otra arquitectura.
  • Problemas de permisos o recursos: En hardware real, puede haber limitaciones de memoria, permisos de dispositivo o falta de drivers.
  • Comandos inválidos en 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.

Pasos para solucionar

1. Verifica la arquitectura del host y la imagen

# Arquitectura del Raspberry Pi (hardware físico)
uname -m

# Arquitectura de la imagen
docker inspect myimage --format '{{.Architecture}}'

Enter fullscreen mode Exit fullscreen mode

Si uname -m muestra armv7l o aarch64, y la imagen reporta amd64, la arquitectura no coincide.

2. Corrige la sintaxis del comando 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

Enter fullscreen mode Exit fullscreen mode

⚠️ Nota crítica: En versiones recientes de Docker, --net=host no funciona en contenedores no Linux (como en Raspberry Pi con armhf), 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.

3. Ejecuta en primer plano para ver el error real

docker run --net=host -it --rm myimage

Enter fullscreen mode Exit fullscreen mode

Elimina -d (background) y añade -it para ver logs en tiempo real y capturar errores.

4. Si la arquitectura es incompatible, usa QEMU

Instala soporte multiarquitectura:

# Instala binfmt-support y QEMU
sudo apt update && sudo apt install -y qemu-user-static binfmt-support

# Registra los binarios QEMU para Docker
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes

Enter fullscreen mode Exit fullscreen mode

Luego ejecuta de nuevo tu contenedor.

5. Verifica logs del contenedor

docker ps -a  # Encuentra el ID del contenedor con Exited (1)
docker logs <container_id>

Enter fullscreen mode Exit fullscreen mode


Bloque de código corregido (ejemplo funcional)

# Paso 1: Verifica arquitectura
uname -m
docker inspect myimage --format '{{.Architecture}}'

# Paso 2: Corrige sintaxis y ejecuta en primer plano
docker run --net=host -it --rm myimage

# Paso 3 (si falla por arquitectura): Instala QEMU
sudo apt update && sudo apt install -y qemu-user-static binfmt-support
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes

# Paso 4: Reintenta
docker run --net=host -d -t myimage

Enter fullscreen mode Exit fullscreen mode


Pro-tip: Construye imágenes nativas para ARM

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

# En el Dockerfile, especifica plataforma explícitamente
FROM --platform=linux/arm/v7 raspbian/stretch

# O para Raspberry Pi 4 (64-bit)
FROM --platform=linux/arm64 ubuntu:22.04

Enter fullscreen mode Exit fullscreen mode

Y construye con:

docker build --platform linux/arm/v7 -t myimage .

Enter fullscreen mode Exit fullscreen mode

Consejo definitivo: Usa docker buildx para construir multiarquitectura:

docker buildx build --platform linux/arm/v7,linux/arm64 -t myimage .

Enter fullscreen mode Exit fullscreen mode

Esto evita 99% de los errores de Exited (1) en Raspberry Pi.


🚀 ¿Quieres más soluciones técnicas?

Si te sirvió esta ayuda, suscríbete para recibir los errores más comunes de la semana y cómo evitarlos.
👉 Suscríbete aquí