[BUG] - Docker image incompatible with readOnlyRootFilesystem (Kubernetes security best practice)
Los mantenedores suelen responder en 2 días
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Internal/External
External
Area
Other - Docker image / Nix wrapper / run-node script
Summary
The cardano-node Docker image (10.6.2) is incompatible with readOnlyRootFilesystem: true in Kubernetes due to two separate issues:
- Scripts mode (
NETWORK=mainnet): The Nix-generated wrapper hardcodes RTS option-tcardano-node.statswhich tries to write to the current working directory - Custom mode (
runarg): The/usr/local/bin/run-nodescript writes to/usr/local/bin/env
Running with readOnlyRootFilesystem: true is a Kubernetes security best practice recommended by CIS benchmarks.
Steps to reproduce
Issue 1 - Scripts mode:
docker run --read-only -e NETWORK=mainnet ghcr.io/intersectmbo/cardano-node:10.6.2
Error: cardano-node: Can't open stats file cardano-node.stats
Issue 2 - Custom mode:
docker run --read-only ghcr.io/intersectmbo/cardano-node:10.6.2 run
Error: /usr/local/bin/run-node: line 93: /usr/local/bin/env: Read-only file system
Expected behavior
The node should start successfully with readOnlyRootFilesystem: true.
System info:
- OS: Kubernetes (EKS) with containerd
- Node version: cardano-node 10.6.2
- Docker image:
ghcr.io/intersectmbo/cardano-node:10.6.2
Logs - Issue 1 (Scripts mode)
Starting: exec /nix/store/.../cardano-node run
...
+RTS
--machine-readable
-tcardano-node.stats
...
-RTS
cardano-node: Can't open stats file cardano-node.stats
Logs - Issue 2 (Custom mode)
Running cardano node ...
CARDANO_BIND_ADDR=0.0.0.0
CARDANO_BLOCK_PRODUCER=false
CARDANO_CONFIG=/opt/cardano/config/mainnet/config.json
CARDANO_DATABASE_PATH=/data/db
CARDANO_LOG_DIR=/opt/cardano/logs
CARDANO_PORT=3001
CARDANO_SOCKET_PATH=/ipc/node.socket
CARDANO_TOPOLOGY=/configuration/topology.json
/usr/local/bin/run-node: line 93: /usr/local/bin/env: Read-only file system
Root Cause
- The Nix wrapper at
/nix/store/.../cardano-node-mainnethardcodes-tcardano-node.statsRTS option - The
run-nodescript'swriteRootEnv()function writes to/usr/local/bin/env
Suggested Fix
- Make the stats file path configurable or write to
/tmpor/data - Write the env file to a writable location like
/tmp/envinstead of/usr/local/bin/env - Or provide a "minimal" mode that skips these writes entirely
Workaround
Disable readOnlyRootFilesystem (reduces security posture).
- Lenguaje dominante
- Haskell
- Estrellas
- 3.2k
- Forks
- 763
- Merge medio
- 3 d 11 h
- PR fusionados (30 d)
- 18
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de IntersectMBO/cardano-node
-
Stale
Dificultad 1/5 1-3 horas Aptitud para principiantes 75/100
IntersectMBO/cardano-node#6597 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
IntersectMBO/cardano-node#6522 · 3 comentarios ·
Los mantenedores suelen responder en 2 días
-
[cardano-testnet] Enhancements for status commandPosiblemente ocupada @palas la tomó hoy. Abierto
IntersectMBO/cardano-node#6747 · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
[cardano-testnet] Modify `renderStatusReportHumanReadable` to return `Doc Ann` instead.Posiblemente ocupada @palas la tomó hoy. Abierto
IntersectMBO/cardano-node#6746 · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
[cardano-testnet] Remove carriage returns in testnet README.md for better diffsPosiblemente ocupada @palas la tomó hace 4 días. Abierto
IntersectMBO/cardano-node#6744 · 1 asignado ·
Los mantenedores suelen responder en 2 días
Todos los issues de IntersectMBO/cardano-node
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 95/100
objectionary/phino#2137 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
fmidue/logic-tasks#387 ·
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
alunduil/network-arbitrary#218 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
iand675/hs-opentelemetry#323 ·
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
alunduil/siren-json.hs#264 ·
Los mantenedores suelen responder en 1 día