testcontainers-dotnet: [Bug]: ryuk container are not shutdown

Testcontainers version

4.1.0

Using the latest Testcontainers version?

Yes

Host OS

Windows

Host arch

x86

.NET version

9.0.102

Docker version

Client:
 Version:           27.5.0-rd
 API version:       1.45 (downgraded from 1.47)
 Go version:        go1.22.10
 Git commit:        7a37716
 Built:             Tue Jan 14 17:50:50 2025
 OS/Arch:           linux/amd64
 Context:           default

Server:
 Engine:
  Version:          26.1.5
  API version:      1.45 (minimum version 1.24)
  Go version:       go1.22.5
  Git commit:       411e817ddf710ff8e08fa193da80cb78af708191
  Built:            Fri Jul 26 17:51:06 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.7.17
  GitCommit:        3a4de459a68952ffb703bbe7f2290861a75b6b67
 runc:
  Version:          1.1.14
  GitCommit:        2c9f5602f0ba3d9da1c2596322dfc4e156844890
 docker-init:
  Version:          0.19.0
  GitCommit:

Docker info

Client:
 Version:    27.5.0-rd
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.19.3
    Path:     /mnt/c/Program Files/Rancher Desktop/resources/resources/linux/docker-cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.32.4
    Path:     /mnt/c/Program Files/Rancher Desktop/resources/resources/linux/docker-cli-plugins/docker-compose

Server:
 Containers: 18
  Running: 1
  Paused: 0
  Stopped: 17
 Images: 31
 Server Version: 26.1.5
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 3a4de459a68952ffb703bbe7f2290861a75b6b67
 runc version: 2c9f5602f0ba3d9da1c2596322dfc4e156844890
 init version:
 Security Options:
  seccomp
   Profile: builtin
 Kernel Version: 5.15.167.4-microsoft-standard-WSL2
 Operating System: Rancher Desktop WSL Distribution
 OSType: linux
 Architecture: x86_64
 CPUs: 24
 Total Memory: 31.2GiB
 Name: CLFPF47JGAG
 ID: cd163be4-8ae6-4913-ba67-44fc96297a11
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
 Default Address Pools:
   Base: 172.27.0.0/16, Size: 20

What happened?

Image

ryuk containers pile up and are not shutdown when the test execution is finished. I would have expected that ryuk shuts itself down and does not leave containers running after the test execution is done.

Relevant log output


Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 28 (13 by maintainers)

Most upvoted comments

There is no workaround except downgrading Rancher Desktop. The next version will address the Rancher Desktop bug by no longer binding the port to IPv4. I am waiting to finalize the Event Hubs PR before publishing the new version.

telnet 127.0.0.1 8080

@HofmeisterAn This is it. Using IPv4 binding the ryuk container does not noticed the closed connection.

EDIT: Perhaps linked to a regression coming from https://github.com/rancher-sandbox/rancher-desktop/issues/7720 ?

We are experiencing the same issue with Rancher Desktop 17.1, downgrading to 16.0 fixes the issue.

Easily reproducible by running the respawn example: https://github.com/testcontainers/testcontainers-dotnet/tree/develop/examples/Respawn

Huge Thanks @HofmeisterAn for this rapid response and issue triaging!

@HofmeisterAn I’ve created an upstream issue. Should I prepare a PR for the changes you’ve mentioned?