From f128f046b870dd467ff0ef77b8ad214c7c0028f8 Mon Sep 17 00:00:00 2001 From: Sunil Singh Date: Wed, 27 Sep 2023 10:40:27 -0700 Subject: [PATCH 1/2] Update index.md with env settings for macOS M1 Rancher Desktop installations. --- docs/supported_docker_environment/index.md | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/docs/supported_docker_environment/index.md b/docs/supported_docker_environment/index.md index 591be528e0e..4596b395151 100644 --- a/docs/supported_docker_environment/index.md +++ b/docs/supported_docker_environment/index.md @@ -60,6 +60,34 @@ export TESTCONTAINERS_RYUK_DISABLED=true Previous to version 1.19.0, `export TESTCONTAINERS_RYUK_PRIVILEGED=true` was required for rootful mode. Starting with 1.19.0, this is no longer required. +## Rancher Desktop + +In order to run testcontainers against [Rancher Desktop](https://rancherdesktop.io/) the env vars below should be set + +If you're running Rancher Desktop as an administrator in a MacOS (M1) machine: + +Using QEMU emulation + +```bash +export TESTCONTAINERS_HOST_OVERRIDE=$(rdctl shell ip a show rd0 | awk '/inet / {sub("/.*",""); print $2}') +``` + +Using VZ emulation + +```bash +export TESTCONTAINERS_HOST_OVERRIDE=$(rdctl shell ip a show vznat | awk '/inet / {sub("/.*",""); print $2}') +``` + +If you're not running Rancher Desktop as an administrator in a MacOS (M1) machine: + +Using VZ emulation + +```bash +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}') +``` + ## Docker environment discovery Testcontainers will try to connect to a Docker daemon using the following strategies in order: From 4fd71d04ed7edebccaae524b9c8b07be8b8fa057 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edd=C3=BA=20Mel=C3=A9ndez=20Gonzales?= Date: Thu, 28 Sep 2023 09:56:25 -0500 Subject: [PATCH 2/2] Update docs/supported_docker_environment/index.md Co-authored-by: Kevin Wittek --- docs/supported_docker_environment/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/supported_docker_environment/index.md b/docs/supported_docker_environment/index.md index 4596b395151..1dc816936c0 100644 --- a/docs/supported_docker_environment/index.md +++ b/docs/supported_docker_environment/index.md @@ -62,7 +62,7 @@ export TESTCONTAINERS_RYUK_DISABLED=true ## Rancher Desktop -In order to run testcontainers against [Rancher Desktop](https://rancherdesktop.io/) the env vars below should be set +In order to run testcontainers against [Rancher Desktop](https://rancherdesktop.io/) the env vars below should be set. If you're running Rancher Desktop as an administrator in a MacOS (M1) machine: