0

Docker-compose cannot be stopped. Only rebooting the whole system helps. Were started from non root user using the command: docker-compose up -d

Command groups $USER is showing this:

sh adm cdrom sudo dip plugdev netdev lpadmin lxd sambashare docker . So user is in group

Trying to stop from root doesn't help too.

sh@sh ~/D/c/ca2 (master)> docker-compose  down
[+] Running 3/3
 ✘ Container canna-redis       Error while Stopping                                         15.3s 
 ✘ Container canna             Error while Stopping                                         15.3s 
 ✘ Container canna-phpmyadmin  Error while Stopping                                         15.3s 
Error response from daemon: cannot stop container: a6eefb47ad582c402792cd0df8bd530686499db6137e606cbd347263ca9435c5: permission denied
sh@sh ~/D/c/ca2 (master) [1]> sudo service docker restart
[sudo] password for sh: 
sh@sh ~/D/c/ca2 (master)> docker-compose  down
[+] Running 3/3
 ✘ Container canna             Error while Stopping                                         14.1s 
 ✘ Container canna-phpmyadmin  Error while Stopping                                         14.1s 
 ✘ Container canna-redis       Error while Stopping                                         14.1s 
Error response from daemon: cannot stop container: a6eefb47ad582c402792cd0df8bd530686499db6137e606cbd347263ca9435c5: permission denied
sh@sh ~/D/c/ca2 (master) [1]> sudo docker-compose  down
[+] Running 3/3
 ✘ Container canna-redis       Error while Stopping                                         14.0s 
 ✘ Container canna             Error while Stopping                                         14.0s 
 ✘ Container canna-phpmyadmin  Error while Stopping                                         14.0s 
Error response from daemon: cannot stop container: a2ff59a4b806a182be91b59cf44f8d235c5a65febe470cc465d98b0392509dfc: permission denied

I'm on Ubuntu 21.10. sudo service docker restart - makes no effect

What am I doing wrong? Thanks

David Maze
  • 130,717
  • 29
  • 175
  • 215
Tebe
  • 3,176
  • 8
  • 40
  • 60
  • 2
    How were the containers started? Is docker running rootless? If not: Is the current user in the corresponding group (probably `docker`)? Can the containers be stopped with `sudo docker-compose down`? – Turing85 Jun 03 '23 at 18:46
  • 1
    [This question and its answer](https://stackoverflow.com/questions/47223280/docker-containers-can-not-be-stopped-or-removed-permission-denied-error) might be of relevance. It looks like the problem could be caused by either apparmor or a mismatching combination of `docker-ce` from `apt` and `docker-compose` from `snap`. – Turing85 Jun 03 '23 at 18:57
  • @Turing85 That is. Easier to update distro to latest stable and not to repeat the mistake using the snap. Danke. If zou place the short link- answer,I'll resolve it. Or just let it be hanging – Tebe Jun 03 '23 at 19:07
  • 1
    Does this answer your question? [Docker Containers can not be stopped or removed - permission denied Error](https://stackoverflow.com/questions/47223280/docker-containers-can-not-be-stopped-or-removed-permission-denied-error) – Turing85 Jun 03 '23 at 19:08
  • Yes, it looks pretty probably like. But I won't try the advice from there since risking the stability of the system is not an option – Tebe Jun 03 '23 at 21:45

0 Answers0