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

ContainerInfo Port bindings are NULL when upgrading to 1.16.0 #4489

Open
eitzenbe opened this issue Sep 29, 2021 · 7 comments
Open

ContainerInfo Port bindings are NULL when upgrading to 1.16.0 #4489

eitzenbe opened this issue Sep 29, 2021 · 7 comments
Labels
resolution/waiting-for-info Waiting for more information of the issue author or another 3rd party.

Comments

@eitzenbe
Copy link

container.getContainerInfo().getNetworkSettings().getPorts().getBindings()

with 1.15.3 returns
"8080/tcp" -> [ "0.0.0.0:49302", ":::49302" ]

with 1.16.0 returns
"8080/tcp" -> null

@kiview
Copy link
Member

kiview commented Sep 29, 2021

Thanks for raising this issue @eitzenbe.
Can you please share some example code or ideally a reproducer (https://github.com/testcontainers/testcontainers-java-repro) with us?

There are some changes in 1.16.0 with regards to the publishing of ports and also parsing the container info, so we would need to see some example code to understand if this behaviour is intended or an actual regression.

@kiview kiview added the resolution/waiting-for-info Waiting for more information of the issue author or another 3rd party. label Sep 29, 2021
@eitzenbe
Copy link
Author

Docker ps -a returns on 1.15.3:

thomas@thomas-laptop:~/IdeaProjects/tiger$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
94e142d9535a gstopdr1.top.local/idp/idp-server:18.2.0-82 "/app/__tigerStart_i…" 23 seconds ago Up 23 seconds (health: starting) 0.0.0.0:49308->8080/tcp, :::49308->8080/tcp focused_germain
b55dc576b73c testcontainers/ryuk:0.3.1 "/app" 25 seconds ago Up 24 seconds 0.0.0.0:49307->8080/tcp, :::49307->8080/tcp testcontainers-ryuk-1b0474e4-05da-4b20-b658-44245a1a8a07

vs. 1.16.0

thomas@thomas-laptop:~/IdeaProjects/tiger$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
31c464e0d3bc gstopdr1.top.local/idp/idp-server:18.2.0-82 "/app/__tigerStart_i…" 3 minutes ago Up 3 minutes (healthy) 8080/tcp tiger.idp2-simple
9740caadcd10 testcontainers/ryuk:0.3.1 "/app" 3 minutes ago Up 3 minutes 0.0.0.0:49290->8080/tcp, :::49290->8080/tcp testcontainers-ryuk-51a723ad-f684-48a9-bc48-52ebee9df580

@eitzenbe
Copy link
Author

Reproducer should be fairly easy, its in Github repo https://github.com/gematik/app-Tiger

module tiger-testlib
class TestTigerDirector
testmethod testDirectorSimpleIdp

But you must adapt src/test/resources/testdata/simpleIdp2.yaml
to use a docker image you have download access to which exposes some port
To do so add a line to the server with name idp2-simple:
source:
- gstopdr1.top.local/idp/idp-server <- replace with a docker image of your choice
version: 18.2.0-82 <- replace wiht your docker image version

@eitzenbe
Copy link
Author

if need be I can also provide the docker image as export tar via dropbox

@kiview
Copy link
Member

kiview commented Sep 29, 2021

Please provide the Java code that is using Testcontainers, else we can't interpret the Docker output.

A reproducer should ideally use the reproducer template I linked to above and provide an isolated example and not require the maintainers to manually modify and understand other projects.

Besides, since your call chain container.getContainerInfo().getNetworkSettings().getPorts().getBindings() is using the docker-java API and not Testcontainers, you might need to raise an issue there.

@eitzenbe
Copy link
Author

OK I will create an internal Ticket at our board and will assign it to someone from the team....

** running down the aisle pushing a million buttons ... **

@bsideup
Copy link
Member

bsideup commented Sep 29, 2021

Hi @eitzenbe,

I am pretty certain this is the result of #4119 - make sure you expose (e.g. by using withExposedPorts(8080)) the port, as we never guaranteed that we will publish all ports, just this is how it was implemented before :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution/waiting-for-info Waiting for more information of the issue author or another 3rd party.
Projects
None yet
Development

No branches or pull requests

3 participants