0

I have a docker container running with persistent storage. When I try to update now I kill the container, and rerun the updated image all over again.

I've considered setting up the new container first, then switching traffic over via NginX, but how would this work with persistent storage? I can't bind the same data to two different containers can I?

Most questions and googling I've done suggest moving over to kubernetes, but for a single-host, 3 container setup, it doesn't seem worth it for such a small application.

1 Answer 1

0

Docker itself does not provide such rolling update feature. You have to do it by hand which is not an easy task. Even if you want to use a one node Swarm cluster, the scheduler does have downtime.

The scheduler applies rolling updates as follows by default:

Stop the first task.
Schedule update for the stopped task.
Start the container for the updated task.

If you only have one machine, you can try something like k3s, which is a lightweight Kubernetes distribution. You'll be able to use a Deployment, a Kubernetes object, which provide zero downtime rolling update feature.

1
  • Thanks for the answer! This definitely helps. Looks like I'm learning Kubernetes after all!
    – ChrisW
    Nov 2, 2020 at 17:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.