解决docker加载新的镜像后repository和tag名称都为none的问题
可以使用命令:
dockertag[imageid][name]:[版本]
例如:
dockertagb03b74b01d97docker-redis:0.0.1
补充知识:docker的save和load
我就废话不多说了,大家还是直接看代码吧~
实战
[root@localhost~]#dockerimages REPOSITORYTAGIMAGEIDCREATEDSIZE clearlinuxlatest32685d1140027daysago62.5MB busyboxlatest6ad733544a637daysago1.13MB alpinelatest053cde6e89537daysago3.96MB [root@localhost~]#dockerrun-itd--nameb1busybox:latest 4bb440e12b85d888f1a8363fe7a3dda977db6d5ed30264f22a31233f61fbf391 [root@localhost~]#dockerps-a CONTAINERIDIMAGECOMMANDCREATEDSTATUSPORTSNAMES 4bb440e12b85busybox:latest"sh"12secondsagoUp11secondsb1 [root@localhost~]#dockercommit4bbox sha256:32d6db8775382ca96a97109bc16bbdedb53b241b7ebeb29498ae7b3672f4f53d [root@localhost~]#dockerimages REPOSITORYTAGIMAGEIDCREATEDSIZE boxlatest32d6db8775386secondsago1.13MB clearlinuxlatest32685d1140027daysago62.5MB busyboxlatest6ad733544a637daysago1.13MB alpinelatest053cde6e89537daysago3.96MB [root@localhost~]#dockerrmibox Untagged:box:latest Deleted:sha256:32d6db8775382ca96a97109bc16bbdedb53b241b7ebeb29498ae7b3672f4f53d [root@localhost~]#dockerimages REPOSITORYTAGIMAGEIDCREATEDSIZE clearlinuxlatest32685d1140027daysago62.5MB busyboxlatest6ad733544a637daysago1.13MB alpinelatest053cde6e89537daysago3.96MB [root@localhost~]#dockerps-a CONTAINERIDIMAGECOMMANDCREATEDSTATUSPORTSNAMES 4bb440e12b85busybox:latest"sh"2minutesagoUp2minutesb1 [root@localhost~]#dockerattach32 Error:Nosuchcontainer:32 [root@localhost~]#dockerattach4b /#ls bindevetchomeprocrootsystmpusrvar /#mkdirtest /#ls bindevetchomeprocrootsystesttmpusrvar /#readescapesequence [root@localhost~]#dockercommit4bbox sha256:00b0b91713e6df2e4047ba0ba0eb14968caa6aaeb647f7069dfcb6b35ca4890a [root@localhost~]#dockerimages REPOSITORYTAGIMAGEIDCREATEDSIZE boxlatest00b0b91713e65secondsago1.13MB clearlinuxlatest32685d1140027daysago62.5MB busyboxlatest6ad733544a637daysago1.13MB alpinelatest053cde6e89537daysago3.96MB [root@localhost~]#dockersave00>box.tar [root@localhost~]#llbox.tar -rw-r--r--.1rootroot1352192Nov1109:28box.tar [root@localhost~]#dockerimages REPOSITORYTAGIMAGEIDCREATEDSIZE boxlatest00b0b91713e63minutesago1.13MB clearlinuxlatest32685d1140027daysago62.5MB busyboxlatest6ad733544a637daysago1.13MB alpinelatest053cde6e89537daysago3.96MB [root@localhost~]#dockerps CONTAINERIDIMAGECOMMANDCREATEDSTATUSPORTSNAMES 4bb440e12b85busybox:latest"sh"7minutesagoUp7minutesb1 [root@localhost~]#dockerrm-f4b 4b [root@localhost~]#dockerps CONTAINERIDIMAGECOMMANDCREATEDSTATUSPORTSNAMES [root@localhost~]#dockerrmi00 Untagged:box:latest Deleted:sha256:00b0b91713e6df2e4047ba0ba0eb14968caa6aaeb647f7069dfcb6b35ca4890a Deleted:sha256:0c496176e68f1db885dbb101c947e63c3733e611563336574144028325e408de [root@localhost~]#dockerimages REPOSITORYTAGIMAGEIDCREATEDSIZE clearlinuxlatest32685d1140027daysago62.5MB busyboxlatest6ad733544a637daysago1.13MB alpinelatest053cde6e89537daysago3.96MB [root@localhost~]#dockerload]3.072kB/3.072kB LoadedimageID:sha256:00b0b91713e6df2e4047ba0ba0eb14968caa6aaeb647f7069dfcb6b35ca4890a [root@localhost~]#dockerload 00b0b91713e65minutesago1.13MB clearlinuxlatest32685d1140027daysago62.5MB busyboxlatest6ad733544a637daysago1.13MB alpinelatest053cde6e89537daysago3.96MB [root@localhost~]#dockerrun-itd--namenew00b 588024b91339f00fe4e3e1dc9e2a1cc8c4bcefd1fbb63eb9561620aef2fe2ad5 [root@localhost~]#dockerps-a CONTAINERIDIMAGECOMMANDCREATEDSTATUSPORTSNAMES 588024b9133900b"sh"15secondsagoUp14secondsnew [root@localhost~]#dockerattach58 /#ls bindevetchomeprocrootsystesttmpusrvar /#readescapesequence
以上这篇解决docker加载新的镜像后repository和tag名称都为none的问题就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持毛票票。