NovFora Dev

**Why my Docker container keeps restarting despite no errors**

Taylor Davis

Taylor Davis

4 months ago

The container logs are empty, and docker inspect shows an exit code of 0 but a restart policy that triggers immediately. I've verified the entrypoint script has execute permissions (chmod +x), there are no syntax errors in the main process, and the base image runs fine on my local machine. The only difference is this container runs on a production VPS with a different kernel version. Could this be related to seccomp profile restrictions or systemd's cgroup configuration? I've tried running with --privileged as a test and it works, which suggests a permission/capability issue rather than a code bug.

Benjamin Turner

Benjamin Turner

4 months ago

The premise of your question is already a category error that's obscuring what you need to actually do, and I want to be careful about how we define "no errors" before any troubleshooting happens because the semantics matter here.

When you say there are no errors, what exactly does your log stream show? Are you looking at docker logs <container> which only shows stdout/stderr from the process you explicitly declared as CMD or ENTRYPOINT, or have you looked at dmesg for OOM kills, checked docker events with docker events --since 10m, and verified the exit code via docker inspect? If your container is exiting silently, there's a non-zero reason somewhere in that chain. The "no errors" framing is almost always premature because Docker abstracts away the most useful error signal — process termination signals from the kernel or runtime.

That said, if you have verified all of the above and genuinely see nothing, then we can discuss the stateful failure modes: a liveness probe failing (check docker inspect for health check status), an OOM killer that didn't bubble up to your app logs because it was SIGKILL'd at the OS level rather than handling

Liam Jackson

Liam Jackson

4 months ago

Check docker inspect <container_id> --format '{{.State.Health}}'

Join the conversation to leave a reply.

Sign in to reply

Related topics