the gradle plugin for the Docker stuff doesn't see...
# ktor
s
the gradle plugin for the Docker stuff doesn't seem to expose a port and I can't find anything to specify it. am I missing something?
t
It depends what you're trying to do, but it looks like the
runDocker
task is hard coded to 8080
Copy code
private abstract class RunDockerTask : DefaultTask() {
    @get:Inject
    abstract val execOperations: ExecOperations

    @get:Input
    abstract val fullImageName: Property<String>

    @TaskAction
    fun execute() {
        execOperations.exec {
            it.commandLine("docker", "run", "-p", "8080:8080", fullImageName.get())
        }
    }
}
Otherwise if you need to configure stuff, behind the scenes the docker creation is done using
jib
which you can configure.
Copy code
jib {
    container {
        ports = listOf("12345")
    }
}
https://github.com/GoogleContainerTools/jib/tree/master/jib-gradle-plugin
s
ah thanks, I will have a look. For now I reverted to a manual dockerfile because neither any hardcoded port showed up as exposed in third parties
a
afaik the port in the dockerfile is just documentation anyway, you can still map any port when running the container
t
I think it will expose it if you just run with
-P
instead of
-p
with ports defined
a
yeah, but who wants random ports for a server process? 😄