Hello there, I’ve been using Docker for a while but I’m new to this forum. I use Docker to deploy services developed by my company, and we constantly need to update the service by recreating the container with the newest image.
As I have many clients and deploy the container on each client server, recreating all containers is challenging and takes hours.
I’ve tried developing a bash script to inspect, copy information, and deploy a new container with the new image. Sometimes it works, sometimes it doesn’t.
Does anyone know a different way to do this? I was hoping Docker had a command to upgrade images.
I am not using Docker Compose… maybe a should, but is there any solution to upgrade image version using Docker CLI… or perhaps is there an open source project that does it?
A. If you’re currently using just the Docker CLI, yes, Docker Compose would help you and simplify your container management
B. You cannot update an existing container. You can remove it, pull the latest version of the image, and then recreate it with the same preferences (That’s why Docker Compose comes in handy, specifying all those preferences in the YAML file instead of the docker run command)