Are you using a distribution with cgroup v2? (e.g. Fedora switched to cgroups v2 in v31 - "Docker no longer works"). You can temporarily switch back to using cgroup v1:
sudo grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy=0"
reboot
In case you want to undo this change this later. This re-enables the usage of cgroup v2 (unified cgroup hierarchy):
sudo grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy"
For more information see this article on how to configure Docker on Fedora
This happens to some users running Fedora OS. Please make sure you have ryuk (a testcontainer dependency) disabled.
export TESTCONTAINERS_RYUK_DISABLED=true
Or when starting from an IDE (e.g. IntelliJ) add
TESTCONTAINERS_RYUK_DISABLED=true
to the environment variables or the run configuration.
3) When I build the project I get a "Current thread does not hold the state lock for project" error...
This has been observed when importing the project in IntelliJ idea.
Try setting property org.gradle.parallel
from true
to false
and try again.