Docker 基于本地模板导入创建镜像
模块获取,可以直接在网上下载一个模快
http://openvz.org/Download/templates/precreated 若下载了一个centos的模板
centos-5-x86.tar.gz 那么导入该镜像的命令为:
cat centos-6-x86_64-minimal.tar.gz |docker import - centos-6-x86_64
把现有镜像,导出为一个文件:
docker save -o centos.tar centos 方便备份迁移
docker save -o centos_with_net.tar f2d895bafc7a
还可以用该文件恢复本地镜像:
docker load < centos_with_net_scott.tar 没有id 和tag
docker tag cc476244f3f2 centos_with_net:scott 命名id tag
docker load --input centos.tar 或者
docker load < centos.tar
docker tag id centos_with_net.tar: tag linux
docker push image_name //可以把自己的镜像传到dockerhub官方网站上去,但前提是需
要先注册一个用户