2月17日 23:40
What are Docker container restart policies?
Docker container restart policies include: no (no automatic restart, default), on-failure (restart when container exits abnormally, can set maximum retry count), always (always restart unless manually stopped), unless-stopped (always restart unless manually stopped or Docker daemon restarts). Use the --restart parameter to specify the restart policy. In production environments, always or unless-stopped are common choices to ensure high service availability. on-failure is suitable for services that may temporarily fail but can automatically recover.