Score:0

Auto re-create docker container when it stops without Kubernetes

ru flag

I've managed to get Docker set up on both a Linux and a Windows host in our organization for internal use.

Now I'd like to set up some "self-cleaning" DevOps worker agents; I've already got a Windows-based image of a DevOps agent prepared on the Windows host which has all we need for our internal build pipelines and which connects to our DevOps when started. Once started it'll keep running pipeline jobs until manually stopped. I can also use the --once flag when starting the agent itself to have it only process one job before shutting down (there's an issue with the script but it's unrelated to this question).

For reference I'm trying to set up what is generically described in this MS document:

If you want a fresh agent container for every pipeline run, pass the --once flag to the run command. You must also use a container orchestration system, like Kubernetes or Azure Container Instances, to start new copies of the container when the work completes.

My question is which on-prem orchestration systems would be able to handle re-creating the stopped containers, and which of them are "light" in terms of set up? Kubernetes is clearly mentioned, but it feels like a very big and complicated system to set up just for our internal DevOps pipelines (and tools like minikube and kind aren't really meant to be used with a Server Core host). Docker Swarm seems much easier to set up but I'm not sure if it can handle the scenario I have in mind.

Score:0
ru flag

Docker Swarm will auto-start stopped containers as needed, and it's possible to create a one-node swarm with only the docker swarm init command. So if Docker's already installed and running then it's very easy to set up.

Obviously this can be scaled up by adding additional docker hosts to the swarm as neede.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.