NetworkMode=host causes starting issue
See original GitHub issueI use the following code to start a container:
private class CustomOracleContainer
extends GenericContainer[CustomOracleContainer](
DockerImageName.parse("mycompany/oracle:enterprise-19.14.0-preloaded-20220120-27-36701e3")
)
private val oracleContainer: CustomOracleContainer = new CustomOracleContainer()
.withExposedPorts(1521)
.withNetworkMode("host")
.waitingFor(Wait.forLogMessage("DATABASE IS READY TO USE!\\n", 1))
.withStartupTimeout(Duration.ofSeconds(160))
With testcontainers 1.15.1
, it works.
When updating to 1.16.3
, I get the following error:
ERROR ?.1.0-preloaded-20220120-27-36701e3] - Could not start container
org.testcontainers.shaded.org.awaitility.core.ConditionTimeoutException: Lambda expression in org.testcontainers.containers.GenericContainer: expected the predicate to return <true> but it returned <false> for input of <InspectContainerResponse(...))> within 5 seconds.
at org.testcontainers.shaded.org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:164)
at org.testcontainers.shaded.org.awaitility.core.AbstractHamcrestCondition.await(AbstractHamcrestCondition.java:86)
at org.testcontainers.shaded.org.awaitility.core.ConditionFactory.until(ConditionFactory.java:939)
at org.testcontainers.shaded.org.awaitility.core.ConditionFactory.until(ConditionFactory.java:645)
Any idea what’s happening ?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:5
- Comments:21 (15 by maintainers)
Top Results From Across the Web
Docker executor fails when network mode is set to host - GitLab
My .gitlab-ci.yml contains a very simple stage, which depends on a service. When I try to execute it with gitlab-ci-multi-runner exec docker ...
Read more >"host" network_mode is incompatible with port_bindings ...
Hi, I am trying to install a Nuclias container running and getting an error on the port binding. Could anyone suggest what needs...
Read more >Task definition parameters - Amazon Elastic Container Service
When running tasks that use the host network mode, do not run containers using ... If you have problems using entryPoint , update...
Read more >Published ports are discarded when using host network mode ...
I am using docker to run Nginx through the Below command: sudo docker run --network=host -p 8443:8443 --rm --name nginx-reverse -v ...
Read more >Docker Networking 101 – Host mode - Das Blinken Lichten
Recall that docker makes rather extensive use of iptables for it's ... If we run two Apache instances in host network mode one...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I use Ubuntu.
Thank you, then it seems we indeed need to support the network mode. I still don’t understand why the Oracle container requires it in this setup, but since it worked in old Testcontainers versions we introduced a regression for this feature and I believe we should try to restore the fuctionality.