testcontainers/testcontainers-java

InternalCommandPortListeningCheck always fails for containers built without `/bin/sh`

Open

#3317 aperta il 11 ott 2020

Vedi su GitHub
 (5 commenti) (7 reazioni) (0 assegnatari)Java (1588 fork)batch import
help wantedtype/bug

Metriche repository

Star
 (7535 star)
Metriche merge PR
 (Merge medio 2g 17h) (2 PR mergiate in 30 g)

Descrizione

Relates to #2984

I'm surprised we've not come across this earlier, but the default TCP port listening detector InternalCommandPortListeningCheck does not work for containers that do not have /bin/sh included.

This predominantly affects images built upon scratch.

The workaround/solution is to use a more application specific WaitStrategy - e.g. an HTTP wait strategy.

However the log messages don't make this easy to realise.

Given that we do both the internal and external port checks for a good reason, I don't think we can just rely on the external port check. Still perhaps we can raise a very specific error message if /bin/sh is not available inside the container.

Guida contributor