Docker Community Forums

Share and learn in the Docker community.

Docker save -o did not include command

I have a weekly script that runs docker save -o with an image
I though this was proper to restore my container.
But now that I needed it to restore, it seems that it’s missing commands to re-deploy my container.

1-Not sure which command I am missing to redeply
2-How to properly create a restorable image of a container in case of failure or misconfiguration? I really need to ensure I keep some kind of backup as deploying from an old stale image is just unbearable

Thanks!

docker run --name rsnapy -it rsnapshot_dec_12_2021
docker: Error response from daemon: No command specified.

docker save saves an image, not a container so it usually does not make sense to save it every week or save it at all. Your container should be stateless (storing date on volumes) so you can recreate it from the image.

How did you “restore” the image? docker load cab be used for that.

I guess the image does not have CMD in its metadata and you did not provide a command at the end of docker run

Yeah. That’s what I thought. :confused:
This is a webmin installation. And everytime I load from the image I get 2 years in the past. Except for my disks So it seems something is not pointin to a stateless volume. But not sure what.

1-I would like to stop this madness and move the system to a volume. How can I do this without rebuilding everything from scratch ?

2-can you help me what is missing in mu command to run it by this image?

3-what is the right way to backup my container volume? The one that will hold my setup/system after I solve #1?

Thanks a lot for your help !!!

Sorry for disappearing. I bookmarked the topic after your message to come back, but I couldn’t. Have you solved it?

If you really need to save a container, use docker export -o container.tar to save and docker import container.tar newimage_name to import it as an image so you can run it again. I am not sure it is enough in all cases. I don’t really use this method.