testcontainers / testcontainers/testcontainers-java

[Enhancement]: Allow withExposedPorts to be called multiple times and append ports

Open
#7,708 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Module

Core

Proposal

Currently the withExposedPorts method on the GenericContainer always overrides the exposedPorts list. It would be very nice if it would just append Ports if its called multiple times.

If you agree, i can create a PR.

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

Start at the GenericContainer.withExposedPorts entry point in the Core module and inspect how repeated calls currently handle the exposed ports list. Done means multiple calls append their ports instead of replacing earlier values; verify the behavior with the relevant Core tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, java
Domain
testing
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.