testcontainers-java icon indicating copy to clipboard operation
testcontainers-java copied to clipboard

2472: Add support for container_name in docker-compose file

Open reggiemcdonald opened this issue 5 years ago • 13 comments

Closes: #2472

This PR adds support for container_name in the docker-compose file by pulling the container names out in ParsedDockerComposeFile and adding some additional logic in DockerComposeContainer

This is my first time contributing to the repo, so any feedback is welcomed.

reggiemcdonald avatar May 15 '20 04:05 reggiemcdonald

I'm not really sure about this failing CI. Any suggestions? I just rebased with master, and it wasnt failing before the rebase

reggiemcdonald avatar Jul 02 '20 05:07 reggiemcdonald

@reggiemcdonald I just triggered a re-run, there was some issue with downloading Gradle stuff

bsideup avatar Jul 02 '20 06:07 bsideup

@bsideup thanks!

reggiemcdonald avatar Jul 02 '20 06:07 reggiemcdonald

@rnorth @bsideup @kiview having this feature is a blocking issue for me is there a plan to merge this change in?

wnyffenegger avatar Aug 27 '20 19:08 wnyffenegger

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this is a mistake, please reply to this comment to keep it open. If there isn't one already, a PR to fix or at least reproduce the problem in a test case will always help us get back on track to tackle this.

stale[bot] avatar Jan 24 '21 03:01 stale[bot]

Thanks @reggiemcdonald great work

Is this still looking to be merged in? Currently the latest version (as of writing this) is 1.15.2 and this issue is still casuing problems.

d3vAdv3ntur3s avatar Mar 14 '21 14:03 d3vAdv3ntur3s

Hi @reggiemcdonald, thank you! Do you have any plan on merging it @rnorth?

james-toussaint avatar Mar 18 '21 15:03 james-toussaint

@reggiemcdonald Can this get merged?

kadaan avatar May 05 '21 16:05 kadaan

Any update on landing this?

eitzenbe avatar Sep 27 '21 11:09 eitzenbe

Hello. I had the same issue recently, I would be grateful if this PR could be merged. Thanks for the hard work !

matthieusb avatar Nov 10 '21 14:11 matthieusb

@rnorth @bsideup @kiview Can this PR be merged, please?

cunhap avatar Nov 16 '21 18:11 cunhap

Is there any news about this PR?

svalexxx avatar Jan 10 '22 08:01 svalexxx

@bsideup or @reggiemcdonald , what's the status here? If you don't have time or energy here, I'm happy to take over the PR

swanysimon avatar Jun 06 '22 19:06 swanysimon

Would also love to see this merged, and can take it over if someone needs to. Status?

jghoman avatar Aug 16 '22 22:08 jghoman

Thanks for the PR @reggiemcdonald, but unfortunately we have to close it. Mainly, there are 2 reasons why we don't want to add support for container_name to DockerComposeContainer:

  1. It requires us to further parse the Docker Compose file and its format has been slightly volatile in the past. So we generally want to avoid further semantically parsing the Docker Compose file, independent from the actual container_name key.
  2. Using container_name would break existing DockerComposeContainer features, like scaling.
  3. As the Testcontainers library, we want to avoid the usage of fixed things, such as ports, names, etc., since those introduce the anti-pattern of integrated tests that can fail depending on the state of the environment in which they are running.

kiview avatar Aug 24 '22 10:08 kiview