Docker commit -> save -> load sequence, did not save whole image

I needed to save container (everything in it) and used docker commit.
Now I used the docker save and needed to restore on another machine using docker load.
However, every steps is successfull except majority of the files I saved on container prior to commit is lost and apparently it is not saving everything.

I see why because, inside docker, I have about 15G of data but docker container list --all --size lists only 300MB file, why? And it is apparently saving only those listed 300MB of data.

Is there a way to commit entire image along data saved on it???

well, i already found partial answer:

“Commits do not include any data contained in mounted volumes.”
Wonder if there is a way to save entire image.

You did save the entire container. The volume is not part of it. You have to save data separately. Data is not committed by design. And it is good that it works like that. It would be also bad idea to save your data into a container image. That data would never change. And every change you make on the data would just increase the size of the container on top of the image layer. The first copy would be also slow depending on how big the changed file is as it would be copied to the container filesystem before changing it.

By the way committing a container is generally a bad practice and should be used only in caases when there is an urgent need to move the container somewhere or delete the container when you or someone else accidentally saved data on the containers filesystem. Otherwise you have to pull existing images from a registry and push your own images (that you built, not commiteed) to one from which you can pull later.

If you want to save the data, you can use docker cp even on a stopped container. I think it should be able to copy volume contents too. In the long term, you can use a custom host path for volumes so you can copy the data more easily.