Home > front end >  When is a Docker Service Considered to be Running?
When is a Docker Service Considered to be Running?

Time:05-17

I am working on a debian based container which runs a c compiled application as a child process to a node.js script. For testing, I am attempting to define a swarm that instantiates this container as a service. When I run "docker service ls", it reports that the service is no running. If I issue "docker ps", however, I can see the identifier for the container and I can use "docker exec" to connect to it.

So far as I can see, the two target processes are running within the container yet, when other containers within the same swarm and using the same networks attempt to connect to this server, I see a name resolution error.

Here is my question: If the intended processes are actively and verifiably running within a container, why would docker consider a service based on that container to not be running? What is Docker's criteria for considering a container to be running as a service?

CodePudding user response:

The status of starting means that it's waiting for the HEALTHCHECK condition to be satisfied.

Examine your Dockerfile's (or compose file's) HEALTHCHECK conditions and investigate why they are not being satisfied.

NOTE: Do not confuse starting with restarting, which means that the program is being launched again (usually after a crash) due to the restart policy.

  • Related