Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: PortBinding does not work anymore since 1.19.2 #7874

Closed
Eng-Fouad opened this issue Nov 26, 2023 · 2 comments
Closed

[Bug]: PortBinding does not work anymore since 1.19.2 #7874

Eng-Fouad opened this issue Nov 26, 2023 · 2 comments
Labels

Comments

@Eng-Fouad
Copy link
Contributor

Module

Core

Testcontainers version

1.19.2 & 1.19.3

Using the latest Testcontainers version?

Yes

Host OS

Windows

Host Arch

x64

Docker version

Docker Desktop 4.25.2 (129061)

What happened?

MSSQLServerContainer mssqlserver = new MSSQLServerContainer();
mssqlserver.getPortBindings().add("5555:1433");

In 1.19.1, it was working fine.
In 1.19.2, it picks random port instead of using 5555.

Relevant log output

No response

Additional Information

No response

@Eng-Fouad
Copy link
Contributor Author

Well, I fixed it using different API:

mssqlserver.addFixedExposedPort(5555, 1433);

@maxime1992
Copy link

☝ this didn't work for me with a localstackcontainer as the method is protected. However in case anyone else is looking for this, I followed this and it worked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants