palantir / gradle-docker

a Gradle plugin for orchestrating docker builds and pushes.
Apache License 2.0
747 stars 158 forks source link

Is there a way to specify multiple ports in dockerRun #295

Open ghost opened 4 years ago

ghost commented 4 years ago

Hi,

Is there a way to specify multiple ports. I tried with

docker run { name containerName image imageName ports ['9042:9042', '9043:9043'] daemonize true } It's not working.

BhavaniShekhar commented 3 years ago

Did you got any response on this?

jgoerner commented 3 years ago

Had the same question, looking at the source code one can pass in a collection of strings, hence the following setting should to the job for you

docker run {
  name containerName
  image imageName
  ports '9042:9042', '9043:9043'
  daemonize true
}