解決docker安裝后運(yùn)行hello-world報(bào)錯(cuò)的問(wèn)題
在centos7.3上yum安裝了docker V1.13。1

但是在運(yùn)行:docker run hello-world的時(shí)候報(bào)錯(cuò):
# docker run docker.io/hello-world container_linux.go:247: starting container process caused "process_linux.go:258: applying cgroup configuration for process caused \"Cannot set property TasksAccounting, or unknown property.\"" /usr/bin/docker-current: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "process_linux.go:258: applying cgroup configuration for process caused \"Cannot set property TasksAccounting, or unknown property.\"".
解決:
主要原因還是centos系統(tǒng)版本兼容性問(wèn)題,如果將系統(tǒng)做更新升級(jí),即可解決。
yum update
更新前:

更新后:

此時(shí)重啟docker,運(yùn)行hello-world:

補(bǔ)充知識(shí):刪除none鏡像
刪除none鏡像
// 停止所有容器
docker ps -a | grep "Exited" | awk '{print $1 }'|xargs docker stop
// 刪除所有停止的容器
docker ps -a | grep "Exited" | awk '{print $1 }'|xargs docker rm
// 刪除所有tag標(biāo)簽是none的鏡像
docker images|grep none|awk '{print $3 }'|xargs docker rmi
可以編輯 ~/.zshrc (或~/.bashrc) 指定指令別名
alias dnone="docker images|grep none|awk '{print $3}'|xargs docker rmi"
source ~/.zshrc
####################官方刪除命令###############
none鏡像產(chǎn)生的原因是:
怎么來(lái)的
結(jié)合第一幅圖,梳理一下dangling images怎么產(chǎn)生的:
第一次構(gòu)建鏡像時(shí)生成的鏡像ID為079dbd67f9f4,此鏡像會(huì)被構(gòu)建工具加上標(biāo)簽bolingcavalry/eureka-server:0.0.1-SNAPSHOT;
第二次構(gòu)建鏡像時(shí)生成的鏡像ID為e40a97f764ef,此鏡像會(huì)被構(gòu)建工具加上標(biāo)簽bolingcavalry/eureka-server:0.0.1-SNAPSHOT,
Docker會(huì)移除079dbd67f9f4的標(biāo)簽,此時(shí)079dbd67f9f4就變成了dangling images,在鏡像列表中展示為<none>:<none>
官方提供如下命令來(lái)刪除,注意:如果該none鏡像被使用,將不會(huì)被刪除:
docker image prune
以上這篇解決docker安裝后運(yùn)行hello-world報(bào)錯(cuò)的問(wèn)題就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持本站。
版權(quán)聲明:本站文章來(lái)源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請(qǐng)保持原文完整并注明來(lái)源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非maisonbaluchon.cn所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來(lái)源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來(lái),僅供學(xué)習(xí)參考,不代表本站立場(chǎng),如有內(nèi)容涉嫌侵權(quán),請(qǐng)聯(lián)系alex-e#qq.com處理。
關(guān)注官方微信