Localstack stop not cleaning up

Recently localstack has stopped removing the stopped container in docker and I’m having to clean up myself. Is there a known issue? I haven’t managed to find anything around this at this time.

Hi @blairham,

Can you please share which containers are not cleaned up?

If it’s about EC2 instances, please be aware:

LocalStack does not clean up any Dockerized instances when shutting down. The Docker containers backing the EC2 instance continue running even after LocalStack is stopped. You need to explicitly call the TerminateInstances API to stop and remove these containers before stopping the LocalStack.

Hi @Marcel,

I’m talking about the localstack docker container.

localstack start -d
localstack stop

Hi @blairham,

If you are using the LocalStack CLI to start the LocalStack container, please be aware of the name of the container. The default name is localstack-main. Your screenshot indicates that the container was stopped.

The stupefied_neumann, is not the main LocalStack Container and will not be closed by the localstack stop command.

You can find more details at Configuration | Docs (localstack.cloud).

Hi @Marcel

That is the only local stack container that was started by the CLI, you can see that by the name of the docker image. I cleared everything out and only ran local stack start and stop. As you can clearly see the container is still there and is not removed when it stopped.

I provided you the two commands I used to
Generated the screen shot I can provide more if you need me to but it no longer removes that image when it’s stopped.

Currently, I can’t reproduce the problem you experience.

Would you be able to provide additional information about your system and Docker desktop?
This appears to be an issue with your local setup.

Hi @Marcel

You see each command and my docker state in between commands

❯ localstack --version
3.1.0

Looking at the code, I can see the cmd here:

I understand the situation. I’ve asked the team to test on their macOS systems, and they say there are no similar problems. Therefore, I would appreciate it if you could provide further details regarding your System and Docker Desktop configuration to assist us in identifying the cause of the discrepancy.

Oh sorry I thought I had included that

❯ docker version
Client:
 Cloud integration: v1.0.35+desktop.11
 Version:           25.0.3
 API version:       1.44
 Go version:        go1.21.6
 Git commit:        4debf41
 Built:             Tue Feb  6 21:13:26 2024
 OS/Arch:           darwin/arm64
 Context:           desktop-linux

Server: Docker Desktop 4.28.0 (139021)
 Engine:
  Version:          25.0.3
  API version:      1.44 (minimum version 1.24)
  Go version:       go1.21.6
  Git commit:       f417435
  Built:            Tue Feb  6 21:14:22 2024
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.6.28
  GitCommit:        ae07eda36dd25f8a1b98dfbf587313b99c0190bb
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0