Environment variable set with `-e` but the app doesn't see it.
IntermediateTroubleshootingContainers that exit, crash or misbehave
Answer
Likely causes → Flag placed after the image name (treated as command args), typo, entrypoint script sanitises env, app reads a config file instead.
Diagnose →
docker exec c env | sort
docker inspect -f '{{.Config.Env}}' c
Fix → docker run -e FOO=bar image (options before image). Check how the app reads variables.
Prevent → Print effective config on startup (without secrets).
More on Containers that exit, crash or misbehave
Container exits immediately with code 0 right after `docker run -d`.Beginner`Exited (137)` with no OOM flag.Intermediate`Exited (139)` segmentation fault.Advanced`Exited (126)` / `Exited (127)`.Beginner`exec /entrypoint.sh: exec format error`Intermediate`docker run` says `WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8)` and the app is very slow.Beginner