I use docker run -it -v /xx1 -v /xx2 [image] /bin/bash
to create a container.
Then commit to image and push to docker hub.
use docker insp
There is a workaround in that you can docker save image1 -o archive.tar
, editing the metadata json file, and docker import -i archive.tar
. That way the history and all the other metadata is preserved.
To help with save/unpack/edit/load I have created a little script, have a look at docker-copyedit. Specifically for your question you would execute
./docker-copyedit.py from [image] into [image2] remove volume /xx1