I'm running Docker on an Ubuntu virtual machine (VM) inside Windows. My Docker setup includes a project with React, FastAPI, LangChain, Postgres, Celery, and Redis, all defined in my docker-compose.yml. When I try to bring my services up with 'docker compose up -d --build', the containers start but soon stop due to various errors (though that's not my main concern right now). The real issue is that when I try to stop the services using 'docker compose down', I get a permission denied error for stopping the containers. I'm currently having to kill each container manually using the PID. I've also checked that my user is part of the docker group and have logged out and back in. Has anyone encountered similar issues? Is there a solution?
3 Answers
You might be facing permission issues because you're using the snap version of Docker. It can conflict with AppArmor settings on Ubuntu. Try checking if you have Docker installed via snap with this command: 'snap list | grep docker'. If you find it there, you might want to uninstall it and install Docker using the APT method instead for smoother operation. Snap containers can have different permission behaviors, so switching to the native installation can really help.
What installation method did you use for Docker? If you went through snap, I recommend transitioning to APT for a better experience. Plenty of users have run into issues with snap Docker setups.
Also, if you verified that your user is in the docker group, make sure to log out and log back in. Sometimes it just doesn't take effect until you restart your session. And just as a confirmation, check the group membership by running 'groups' in the terminal to ensure you're all set.

Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures