score:4
original java library has answer to your port question.
https://www.testcontainers.org/features/networking/
note that this exposed port number is from the perspective of the container.
from the host's perspective testcontainers actually exposes this on a random free port. this is by design, to avoid port collisions that may arise with locally running software or in between parallel test runs.
because there is this layer of indirection, it is necessary to ask testcontainers for the actual mapped port at runtime. this can be done using the getmappedport method, which takes the original (container) port as an argument
in scala library you can get this mapped port by calling
container.mappedport(yourexposedport)
error is most likely related to this concept, you need to expose that port in advance, inside your docker image. make sure that you either have expose 8080
command somewhere in your dockerfile or any image that is used to build yours have it
Source: stackoverflow.com
Related Query
- Timed out waiting for container port to open (localhost ports: [32773] should be listening)
- Kafka topic creation: Timed out waiting for a node assignment
- Scala Play 2.2 Slick 1.0.1 - future { Try {...} } Timed out waiting for a free available connection
- Gremlin with Neptune : Timed out while waiting for an available host
- akka-http HttpEntity.toStrict timed out while still waiting for outstanding data
- Should I use Unit or leave out the return type for my scala method?
- What are possible reasons for receiving TimeoutException: Futures timed out after [n seconds] when working with Spark
- How to give port number for docker container at run time?
- Database times out waiting for a free available connection
- Using a single actor for in and out ports of a Flow
- Akka actors always times out waiting for future
- Jvm takes a long time to resolve ip-address for localhost
- Why does join fail with "java.util.concurrent.TimeoutException: Futures timed out after [300 seconds]"?
- Scala waiting for sequence of futures
- For my next project, a web-app, should use scala+wicket or scala+lift?
- What parts of the Java ecosystem and language should a developer learn to get the most out of Scala?
- Scala / Slick, "Timeout after 20000ms of waiting for a connection" error
- What library should I use for accessing Riak from Scala?
- Scalatest: waiting for an assertion to become true
- Why should one prefer Option for error handling over exceptions in Scala?
- Cannot figure out what =:=[A,B] stands for
- Which HBase connector for Spark 2.0 should I use?
- How do you open a single project for Java, Scala and JRuby in Eclipse?
- Open source applications for the Lift web framework
- Is there any Non-blocking IO open source implementation for Scala's actors?
- Akka Actor - wait for some time to expect a message, otherwise send a message out
- What should I import for Scalaz' traverse functionalities
- Spark job restarted after showing all jobs completed and then fails (TimeoutException: Futures timed out after [300 seconds])
- Which cross platform scripting language should we adopt for a group of DBAs?
- Filter out rows with NaN values for certain column
More Query from same tag
- Return function in Scala
- Specify parametric functions as inputs without overly constraining them in Scala
- How to configure a fine tuned thread pool for futures?
- How can I write a typeclass in scala on a container type, returning an element from the container?
- Pass argument to sbt task
- Squeryl - HikariCP - mySql - Distributing Read Traffic to Slaves
- Scala: How can I create a function that has multiple possible return types? (given this edge case inside)
- Scala : How do i successfully plot this barchart?
- IntelliJ IDEA stopped offering Run... commands for Scala project after upgrading to 2019.3.3
- Scala Spark - java.lang.UnsupportedOperationException: empty.init
- Get Value out of Option[Any] = Some(Map)
- scalacheck: Generate a non empty string
- Scala difference between (1 to 4).toSet and (1 to 4).to[scala.collection.immutable.Set]?
- How to create dynamic group in PySpark dataframe?
- Complex Slick Join Query
- Asterisk in val name using Scala
- Nested futures in Akka
- Android, scala and eclipse = unstable blend
- Play Framework Form validation messages with Twitter Bootstrap fields
- Akka Streams, break tuple item apart?
- access values from enumerations scala object doesn't work
- Is there a Rubocop for Scala?
- spark scala cartesian product of each element in a column
- (java/scala) MultiHashMap with mutable bucket?
- How to determine type parameter's variance?
- Repeating dependent parsers with Scala/SBT parser combinators
- Get sequence of types from HList in macro
- Sbt assembly JVM settings
- howto verify that akka actor exists by name
- How to create a typeclass instance for any subclass of Traversable in Scala