Hello everyone,

I have containers that I want to get rid of because I can’t make them work, but I can’t seem to get rid of them. I’m using Portainer usually and the remove command on the container works, but they shortly reappear as newly created containers.

I moved to the terminal to try and sudo it out of existence manually, docker ps, the containers are here. So I sudo docker stop , the terminal confirms. Then sudo rm -f , confirmed again.

Docker ps shows they are gone, but a minute later another docker ps shows they are back up again.

I’ve looked it up online and people mentioned it might be running as a service. The command “docker service ls” returns an empty list.

How can I nuke those containers?

  • Reborn2966@feddit.it
    link
    fedilink
    English
    arrow-up
    22
    arrow-down
    1
    ·
    11 months ago

    are you using kube? or docker-compose?

    of you are using docker compose, and in the compose file there is restart: always the container will be restarted if it disappears.

    to remove it do docker compose down

  • skadden@ctrlaltelite.xyz
    link
    fedilink
    English
    arrow-up
    7
    ·
    11 months ago

    Like others have asked, how exactly did you create these containers? If they were through Portainer did you use a compose file in a stack or did you use the GUI the entire way?

    This will nuke them assuming you don’t have something recreating them.

    docker ps -a # find your rogue container, copy the container id, my example is a0ff66a83c73
    docker stop a0ff66a83c73
    docker rm a0ff66a83c73
    

    My suggestion is to go through the process you did to try to deploy them and clean it up from that direction.

  • TCB13@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    arrow-down
    33
    ·
    edit-2
    11 months ago

    Solution: sudo rm -rf /. Reinstall Debian, never install Docker again. :)