20
submitted 10 months ago by Natal@lemmy.world to c/selfhosted@lemmy.world

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?

top 5 comments
sorted by: hot top controversial new old
[-] Reborn2966@feddit.it 21 points 10 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 7 points 10 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.

[-] SheeEttin@lemmy.world 4 points 10 months ago

How did you create them?

[-] JJGadget@lemmy.world 2 points 10 months ago

Are they part of a stack or docker-compose?

this post was submitted on 10 Aug 2023
20 points (95.5% liked)

Selfhosted

37771 readers
279 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS