Docker 使用方法总结之:镜像,docker总结


  • 另存为
    命令:docker save [OPTIONS] IMAGE [IMAGE...]
    参数:  -o, --output=""    Write to a file, instead of STDOUT
    例子:
    docker save -o centos6_ansible.tar eric/ansible
  • 导入
     命令:docker load [OPTIONS]
    参数:   -i, --input=""     Read from a tar archive file, instead of STDIN
    例子:
    docker load --input centos6_ansible.tar
  • 上传
    首先取个便于识别的TAG
    [root@localhost ~]# docker tag 6e38 sun7545526/template:ansible
    [root@localhost ~]# docker images
    REPOSITORY            TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
    sun7545526/template   ansible             6e3832e7c6e1        17 minutes ago      629.7 MB
    eric/ansible          latest              6e3832e7c6e1        17 minutes ago      629.7 MB

    执行上传命令,第一次上传的时候会要求输入用户名,密码,邮箱信息:
    [root@localhost ~]# docker push sun7545526/template:ansible
    The push refers to a repository [sun7545526/template] (len: 1)
    Sending image list
    Pushing repository sun7545526/template (1 tags)
    511136ea3c5a: Image already pushed, skipping
    1d6ebc5c68b1: Image already pushed, skipping
    f01c1b138488: Image already pushed, skipping
    6e3832e7c6e1: Image successfully pushed
    Pushing tag for rev [6e3832e7c6e1] on {https://cdn-registry-1.docker.io/v1/repositories/sun7545526/template/tags/ansible}
  • 相关内容