Menu

1 / 3

Docker Container Restarting in a Loop: 5 Causes, Fixed

DEV Community: docker·GDS K S·5 days ago
#7sOT5LOt
Reading 0:00
15s threshold

A container stuck on Restarting (1) 5 seconds ago is the most common way a deploy fails on a single server. The status tells you almost nothing, but two numbers do: the exit code and whether the kernel killed the process.

Part 6 of 7 in the Deploy and operate Levelrail series: 1. Install a Self-Hosted PaaS on Your Own Server in Five Minutes ; 2. Roll Back a Failed Docker Deploy Without Downtime ; 3. Restart a Docker Container Without Downtime ; 4. Node Graceful Shutdown in Docker: Handle SIGTERM on Deploy ; 5. Update the PHP Docker Image Security Patch, No Downtime ; 6. Docker Container Restarting in a Loop: 5 Causes, Fixed (this post); 7. Why a Failed Health Check Still Went Live .

In this guide we reproduce five distinct causes with plain Docker, show the exact command that finds each one, and fix it. Then we ship the same kind of crash to a Levelrail app and look at what the user sees.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.