testcontainers / testcontainers/testcontainers-java

[Feature]: Add exposing host port support to `DockerComposeContainer`

Open
#5,687 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

type/feature
Dominant language
Java
Stars
8.7k
Forks
1.9k
Avg merge
2d 17h
Merged PRs (30d)
9

Description

Module

Core

Problem

cannot make a container inside the docker compose network to communicate with the docker host machine via a specific port.

Solution

use the same port forwarding mechanism that GenericContainer has in order to expose a host port to the docker compose network.

Benefit

containers inside docker compose to communicate back with a test that verifies some e2e scenario.

Alternatives

create some container inside the compose and communicate with it.

Would you like to help contributing this feature?

No

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names the Core module, DockerComposeContainer, and GenericContainer; start by comparing how GenericContainer exposes host ports. Trace the Docker Compose network setup and determine how a compose container should reach the test host through a specified port. Done means an exposed host port is usable from containers in the compose network, with coverage for the end-to-end scenario described.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, docker-compose, java
Domain
networking, testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.