Use host networking to access services on the host or in service containers #29
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.
This PR adds a
--network host
argument to thedocker run
command that executes PHPUnit within its own container. This way, the container is not bound to the default bridge network (where it is in practice isolated from other containers and the host system in terms of networking) but instead stays on the host network. It can access services running on the host (e.g. a MySQL daemon). If service containers are used, they can also be accessed as long as their ports are exposed to the host machine using aports
declaration.See #28 for some background.
I've tested this using my own fork osma/phpunit and it works in my case (accessing a Fuseki service on the host machine). If you want to try it out you can use it like this:
Fixes #28
Fixes #26 (probably)