让我们说一个官方docker基础图像ubuntu:latest,我有一个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
Run Code Online (Sandbox Code Playgroud)
我push只需latest-new减去delta latest.
And*_*ndy 20
使用docker tag ubuntu:latest myaccount/ubuntu:latest.(您还应该使用特定的版本号进行标记,以便在更新时仍可以引用该图像:最新版本)
然后docker push myaccount/ubuntu.
它实际上不会复制,但会将新标记添加到现有图像中.除非他们,否则其他人不会看到标签docker pull myaccount/ubuntu.
Macos使用该命令
$ docker pull NAME:tag
$ docker tag NAME:tag myaccount/name:tag
$ docker login
# yourname
# password
$ docker push myaccount/name:tag
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6974 次 |
| 最近记录: |