假设ubuntu:latest和我有一个官方的docker基础镜像,我们有一个dockerhub账户myaccount。如何将ubuntu:latest克隆到myaccount的仓库中,工作流程介绍如下:
$ docker pull myaccount/ubuntu:latest
$ docker run -it myaccount/ubuntu:latest /bin/bash
# root@mycontainer: apt-get install onepackage
# root@mycontainer: exit
$ docker commit mycontainer myaccount/ubuntu:latest-new
$ docker push myaccount/ubuntu:latest-new我需要push,就是latest-new减去latest。
发布于 2014-08-15 04:30:32
使用docker tag ubuntu:latest myaccount/ubuntu:latest。(您还应该使用特定的版本号进行标记,以便在更新时仍然可以引用镜像:latest)
然后是docker push myaccount/ubuntu。
它实际上不会制作副本,但会将新标记添加到现有图像中。其他人不会看到标签,除非他们docker pull myaccount/ubuntu。
发布于 2017-07-28 11:22:35
Macos使用命令
$ docker pull NAME:tag
$ docker tag NAME:tag myaccount/name:tag
$ docker login
# yourname
# password
$ docker push myaccount/name:taghttps://stackoverflow.com/questions/25310770
复制相似问题