diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 94bcbc8f..4f4ac85e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -84,6 +84,24 @@ export TESTCONTAINERS_RYUK_PRIVILEGED=true when running TestContainer-based Model Registry Python tests (for more information, see [here](https://pypi.org/project/testcontainers/#:~:text=TESTCONTAINERS_RYUK_PRIVILEGED)). +#### Fedora + +Fedora requires further setup to make testcontainers work with Podman, the following steps are required: + +- start the podman socket service + +```sh +systemctl --user start podman.socket +``` + +- set the environment variable + +```sh +export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/podman/podman.sock +``` + +If you need more information, please refer to the [Testcontainers using Podman](https://golang.testcontainers.org/system_requirements/using_podman/). + ### Colima Colima offers Rosetta (Apple specific) emulation which is handy since the Google MLMD project dependency is x86 specific. diff --git a/internal/testutils/test_container_utils.go b/internal/testutils/test_container_utils.go index 0a1c21c3..6601a875 100644 --- a/internal/testutils/test_container_utils.go +++ b/internal/testutils/test_container_utils.go @@ -8,6 +8,7 @@ import ( "fmt" "os" "os/exec" + "strings" "testing" "github.com/docker/docker/api/types/container" @@ -90,6 +91,7 @@ func SetupMLMetadataTestContainer(t *testing.T) (*grpc.ClientConn, proto.Metadat hc.Binds = []string{wd + ":/tmp/shared"} }, WaitingFor: wait.ForLog("Server listening on"), + Privileged: true, } useProvider := defaultProvider @@ -164,5 +166,5 @@ func tryDetectPodmanRunning() bool { if err != nil { return false } - return info.Host.MachineState == "Running" + return info.Host.MachineState == "Running" || strings.Contains(os.Getenv("DOCKER_HOST"), "podman.sock") }