I'm a bit new to docker and I have created images using docker-compose. But when I'm trying to stop or delete images it shows PermissionDenied
, I even tried to do this using the root user but no effect. I have almost tried all methods and commands written on stack overflow. Also, I have tried to remove docker from the system, but it showed containers are running so can't remove docker. And nothing helped.
Can anyone tell me what can be the possible issue and how can I resolve this?
how can I delete those images?
Below are the commands and output that I have tried
shivam@flintrider:~$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
dbd59e4554b0 postgres:13 "docker-entrypoint.s…" 3 weeks ago Up 3 hours (healthy) 5432/tcp airflow-postgres-1
shivam@flintrider:~$ docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
airflow-airflow-init latest c84dcacd60e9 5 hours ago 1.45GB
postgres 13 2de938a8d18d 4 weeks ago 374MB
shivam@flintrider:~$ docker stop $(docker ps -q)
Error response from daemon: cannot stop container: dbd59e4554b0: permission denied
shivam@flintrider:~$ sudo docker stop $(docker ps -q)
[sudo] password for shivam:
Error response from daemon: cannot stop container: dbd59e4554b0: permission denied
shivam@flintrider:~$ docker kill dbd59e4554b0
Error response from daemon: Cannot kill container: dbd59e4554b0: permission denied
If you need any other info, please let me know. I would appreciate any help.
Thanks :)