Redownload all Docker Images

I recently ran into a problem where my docker server had lost all of the images for the running containers. So when the containers were attempted to be cycled there was no image to start up and the container was then shutting down.

With some quick thinking I was able to use the following command to redownload all of the images on the machine one by one which solved my problem.

docker service ls --format "{{.Image}}"|xargs -I xxx docker image pull xxx

This entry was posted in DevOps. Bookmark the permalink.

Leave a Reply