How to easily update the docker deployment image without downtime

I have a mirror service, and the external mapping port is 8787 . Now I need to update this image service. How to update it without downtime in the update process?
the current solution is to use nginx as a proxy, and then write a script. The update steps are as follows:
1, start the new image, and the corresponding mapping port is 9797 ,
2. After checking that the image is started successfully, point the nginx to 9797,
3, and then redeploy the 8787 service. After checking that the image is started successfully, point the nginx to the 8787 port, then close the 9797 port, and finally the hot deployment is completed.

I"m too lazy to write scripts now. Is there any way to be simple, fast and stable? And it can be rolled back flexibly.

Mar.22,2021

you can try docke run-v to update resources on the host.


use rancher for container management and configure docker health check. Based on health check, non-stop updates will be realized automatically.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3706d-2c054.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3706d-2c054.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?