How to run tests with TestContainers without Docker Desktop (MacOS)
Step-by-step guide
- Remove the Docker Desktop from the machine.
- Download the Rancher Desktop installer from the release page (aarch64 for Apple processors, x86_64 for Intel)
- Install Rancher Desktop
- Open settings and configure Docker Desktop in the following way:
- Disable Administrative Access in the General Section:
- Change Virtual Machine Type to VZ:
- Change Container Engine to dockerd(moby)
- Optionally: adjust hardware parameters
- Restart your computer and reopen Rancher Desktop
- Add the next environment variables and run your tests:
export DOCKER_HOST=unix://$HOME/.rd/docker.sock export TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE=/var/run/docker.sock export TESTCONTAINERS_HOST_OVERRIDE=$(rdctl shell ip a show vznat | awk '/inet / {sub("/.*",""); print $2}')