docker cannot stop container问题解决

docker 容器在启动时出现异常,删除容器或者暂停容器时会出现cannot stop container

先使用sudo aa-remove-unknown ,再进行其他操作

lgj@lgj-Lenovo-G470:~/java/start$ docker ps      
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES
4f36ce88f0af        d0d78741cdec        "java -jar /worker/b…"   43 minutes ago      Up 43 minutes       0.0.0.0:8703->8703/tcp   microblog-blog-web
lgj@lgj-Lenovo-G470:~/java/start$ docker start microblog-blog-web
microblog-blog-web
lgj@lgj-Lenovo-G470:~/java/start$ docker stop microblog-blog-web
Error response from daemon: cannot stop container: microblog-blog-web: Cannot kill container 4f36ce88f0af0a01ac675742de6e848576f1ba74f839267eec3dd4fa57d89f98: 
unknown error after kill: docker-runc did not terminate sucessfully: container_linux.go:393: signaling init process caused "permission denied": unknown

lgj@lgj
-Lenovo-G470:~/java/start$ aa-remove-unknown

/usr/sbin/aa-remove-unknown: 66: /usr/sbin/aa-remove-unknown: cannot open /sys/kernel/security/apparmor/profiles: Permission denied ERROR: Unable to read apparmorfs profiles file lgj@lgj-Lenovo-G470:~/java/start$ sudo aa-remove-unknown

[sudo] password
for lgj: Removing 'docker-default' lgj@lgj-Lenovo-G470:~/java/start$ docker stop microblog-blog-web microblog-blog-web lgj@lgj-Lenovo-G470:~/java/start$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

aa-remove-unknown将清点/etc/apparmor.d/中的所有配置文件,将该列表与当前加载到内核中的配置文件进行比较,然后删除/etc/apparmor.d/中未找到的所有已加载配置文件。 它还将报告在标准输出时删除的每个配置文件的名称。 

posted @ 2019-06-16 23:43  冬眠的山谷  阅读(7659)  评论(0编辑  收藏  举报