pull image busybox
start a container from busybox image
add a new folder /home/test on the running container
commit the running container to another image busybox-1
image "busybox-1" contains the changes done to "busybox"
... can create a new image from a running container (and all it changes)
using docker commit container-id image-name
the exported-imported image has lost all of its history
the saved-loaded image still have its history and layers.
Do I need to stop container defore export it to tar file?
... No, you should also be able to export a running container.
//=== export/import targets container
$ docker export container1 > c1.tar
$ cat c1.tar | docker import - c1-export:latest
[the result of import is a newly created image "c1-export:latest"]
[xxx need repository server xxx]
//=== save/load targets image
$ docker save img1 > i1.tar
$ docker load < i1.tar //=== ??? $ docker images --tree imgname [Warning: '--tree' is deprecated, it will be removed soon. See usage.] --> $ docker images -a imgname
$ docker export -h
$ docker save -h
$ docker commit -h [xxx need repository server xxx]
//=== "docker push" need repository server
$ docker push ipynb:t4
--> You cannot push a "root" repository.
Please rename your repository in username/reponame (ex: u1333/ipynb:t4)
to rename image
docker tag ipynb:t4 username/reponame:t4
docker tag img_id username/reponame:t4