免責聲明

Disclaimer (免責聲明)
繼續閱覽代表您接受以上的免責聲明.
To continue reading means you accept the above disclaimer.

2015年3月6日 星期五

docker export/import, pull/commit/push, save/load


//=== http://tuhrig.de/difference-between-save-and-export-in-docker/
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
whereas
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

or

docker tag img_id username/reponame:t4



沒有留言:

張貼留言