作者热门文章
- mongodb - 在 MongoDB mapreduce 中,如何展平值对象?
- javascript - 对象传播与 Object.assign
- html - 输入类型 ="submit"Vs 按钮标签它们可以互换吗?
- sql - 使用 MongoDB 而不是 MS SQL Server 的优缺点
我已经创建了自己的 docker 文件(运行一个打印“helloworld”的 shell 脚本)。图片是“hellodocker”,标签是“mytag”我现在有:
bash-3.2$ docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
hellodocker mytag 3514c8dc11a8 39 minutes ago 2.433 MB
busybox buildroot-2013.08.1 d200959a3e91 10 weeks ago 2.489 MB
busybox ubuntu-14.04 37fca75d01ff 10 weeks ago 5.609 MB
busybox ubuntu-12.04 fd5373b3d938 10 weeks ago 5.455 MB
busybox buildroot-2014.02 a9eb17255234 10 weeks ago 2.433 MB
busybox latest a9eb17255234 10 weeks ago 2.433 MB
docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
97c29510069e hellodocker:mytag /bin/sh -c /Users/in 33 minutes ago Exited (127) 26 minutes ago happy_pasteur
8d04a1385c24 hellodocker:mytag /bin/sh -c /Users/in 37 minutes ago Exited (127) 30 minutes ago mad_bell
8998d61c0513 hellodocker:mytag /bin/sh -c /Users/in 37 minutes ago Exited (127) 30 minutes ago boring_thompson
64314c304a29 hellodocker:mytag /bin/sh -c /Users/in 37 minutes ago Exited (127) 31 minutes ago sad_wilson
8bc20e0555b8 hellodocker:mytag /bin/sh -c /Users/in 38 minutes ago Exited (127) 31 minutes ago sleepy_mayer
97664a4ba870 hellodocker:mytag . 38 minutes ago kickass_poincare
8bb752631cb6 busybox:buildroot-2014.02 /bin/echo Hello Doct 18 hours ago Exited (0) 18 hours ago dreamy_kowalevski
6aa66b55ca94 busybox:buildroot-2014.02 bash-3.2$ sudo docke 18 hours ago ecstatic_lovelace
2cc657f65342 busybox:buildroot-2014.02 /bin/echo Hello Dock 18 hours ago Exited (0) 18 hours ago dreamy_poincare
如何将 docker 镜像推送到 dockerhub?我用 docker push <myuserid>/hellodocker
.这给出了“没有这样的 id”错误。我错过了什么?提前致谢。
最佳答案
您需要将其标记为 <myuser>/hellodocker
当你构建它时,例如 g
docker build -t <myuser>/hellodocker:mytag .
或者创建一个绑定(bind)到同一张图片的新标签,例如
docker tag hellodocker:mytag <myuser>/hellodocker:mytag
关于docker - 将 docker 镜像推送到 dockerhub,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25388684/
我是一名优秀的程序员,十分优秀!