杀死Docker容器权限被拒绝

I'm new to Docker and here what I'm trying to do is delete docker container using docker kill command. I'll show below what I have done so far,

Step1: docker run --rm -ti ubuntu sleep 3000
Step2: docker ps enter image description here Step3: docker kill frosty_bose

来自守护程序的错误响应:无法终止容器:quizzical_taussig:无法终止容器

enter image description here

To solve the problem I have gone through StackOverflow and found this solution which didn't work for me and there is a comment from @AVarf "Be aware, any solution containing apparmor will break snap and all the packages installed via snap and even after that I still have problem with running and killing pods on Kubernetes." So can anyone suggest a safe method for kill the container without having the permission denied error message?

PS:我正在使用Ubuntu18操作系统,并且使用docker官方网站安装了docker和docker-compose。 (不使用快照包)

评论
  • 所以狠在乎
    所以狠在乎 回复

    you need to use sudo, or alternatively, add your user to the docker group and reload the session.