• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Mister PKI

SSL Certificates * SSL Tools * Certificate Decoder

  • PKI Training
  • OpenSSL
  • Keytool
  • PKI Tools
    • Apereo CAS
    • SAML
    • OpenID Connect
  • Get expert help

Docker container keeps restarting

June 2, 2022 by Mister PKI Leave a Comment

The purpose of this article is to detail how to recover from a docker container that keeps restarting.

So, you have built a new docker container and are attempting to run it. The container builds just fine, but you notice that on startup it isn’t available. You decide to run the following command to show what docker containers are running.

docker ps -a

The result for the container that isn’t starting properly is:

Restarting (127) x seconds ago

You check time and time again and you continue to see the same message, but perhaps with a different number of seconds. The restart appears to be in a loop, which it is, but it is never able to successfully start. This could be for any number of reasons so you will have to analyze the docker logs to figure out what the problem actually is. It’s unlikely that the problem is with docker itself, but rather with the application or process you are attempting to run in your container. To display the logs that should show you what the problem is run the following command:

docker logs --tail 50 --follow --timestamps mediawiki_web_1

This will only get you to the next phase of troubleshooting the application or process you are trying to run, but after fixing the problem your docker container should successfully start and run.

Conclusion

This article has demonstrated how to trouble shoot when you have a docker container that keeps restarting. Leave us a comment if you have any questions and please check out our other posts!

docker

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Popular Posts

PKCS12

openssl s_client

Keytool

Keytool list

ECDSA vs RSA

OpenSSL

PKCS7

Certificate Decoder

PKI for DevOps Engineers – Free Training Series

PKI for DevOps Training Hub

Lesson 1 – How TLS and PKI Work

Lesson 2 – Understanding X.509 Certificates

Lesson 3 – Certificate Chains Explained

Lesson 4 – Debug TLS with OpenSSL

Lesson 5 – Verify Certificate Chains

Lesson 6 – Creating CSRs with OpenSSL

Lesson 7 – Working with PKCS12 Certificates

Lesson 8 – Java Keystores and keytool

Lesson 9 – Certificate Expiration Monitoring

Lesson 10 – Automating Certificate Renewal

Lesson 11 – Common TLS Errors

Lesson 12 – PKI Architecture for DevOps

Recent Posts

  • Apache mod_auth_cas: Protect Web Applications with Apereo CAS and Docker
  • Apache mod_auth_mellon: Configure SAML SSO & Docker
  • Configure OpenID Connect (OIDC) in Apereo CAS 7.3 and 8
  • Certificate Ownership Is an Operating Model Problem, Not a Tooling Problem
  • OpenSSL dgst: Create Checksums and Verify Digital Signatures

Footer

  • Twitter
  • YouTube
Mister PKI

Practical security engineering for the systems that establish trust.

Learn OpenSSL Keytool Free training
Work together PKI consulting CAS consulting Sponsored contributions
Site About Support Mister PKI Cookie policy Search
© 2026 Mister PKI Secure systems. Clear guidance.