This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -70,18 +70,21 @@ However, sometimes customization is required. Testcontainers-Python will respect
3. Read the **DOCKER_HOST** environment variable. E.g. `DOCKER_HOST=unix:///var/run/docker.sock`
See [Docker environment variables](https://docs.docker.com/engine/reference/commandline/cli/#environment-variables) for more information.
4. Read the default Docker socket path, without the unix schema. E.g. `/var/run/docker.sock`
4. Read the **current Docker context** (as set by `docker context use`) and use its host. E.g. with a context pointing at `ssh://user@remote-host`, no extra configuration is needed.
The built-in `default` context is skipped so local sockets / named pipes go through the standard fallback.
5. Read the **docker.host** property in the `~/.testcontainers.properties` file. E.g. `docker.host=tcp://my.docker.host:1234`
5. Read the default Docker socket path, without the unix schema. E.g. `/var/run/docker.sock`
6. Read the rootless Docker socket path, checking the following alternative locations:
6. Read the **docker.host** property in the `~/.testcontainers.properties` file. E.g. `docker.host=tcp://my.docker.host:1234`
7. Read the rootless Docker socket path, checking the following alternative locations:
1. `${XDG_RUNTIME_DIR}/.docker/run/docker.sock`
2. `${HOME}/.docker/run/docker.sock`
3. `${HOME}/.docker/desktop/docker.sock`
4. `/run/user/${UID}/docker.sock`, where `${UID}` is the user ID of the current user
7. The library will raise a `DockerHostError` if none of the above are set, meaning that the Docker host was not detected.
8. The library will raise a `DockerHostError` if none of the above are set, meaning that the Docker host was not detected.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(core): auto-detect DOCKER_HOST from current docker context #1026
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(core): auto-detect DOCKER_HOST from current docker context #1026
Filter by extension
Viewed files
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
Uh oh!
There was an error while loading. Please reload this page.