Skip to content

Port mapping problems when using wormhole pattern #37

Closed

Description

@rnorth

I've encountered a couple of problems when running in a Docker-in-Docker environment when the using the 'wormhole' pattern. In this context, our test is executed inside a container, and all containers are created as siblings (alongside it).

The biggest problem is that the port mapping seems to be incorrect - get_exposed_port returns the original port when running inside a container:

def get_exposed_port(self, port) -> str:
if inside_container():
return port
else:
return self.get_docker_client().port(self._container.id, port)

In testcontainers-java we don't have such a branch and it works well in all contexts I'm aware of. I can't really see the reason for the branch.

I'd be keen to submit a pull request, but want to check whether there's a specific reason for the current code path in case we break a usage I'm not aware of!

Activity

  1. tuvshuud commented on Apr 28, 2020

    @tuvshuud
    Contributor

    @rnorth Does #85 address this issue?

  2. tillahoffmann commented on Jun 8, 2020

    @tillahoffmann
    Contributor

    @rnorth, closing this issue for now. Feel free to reopen if it continues to be a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions