testcontainers / testcontainers/testcontainers-java
[Feature]: Add exposing host port support to `DockerComposeContainer`
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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