Fabio Beoni
04/13/2024, 8:12 PMError running 'jvm in docker' Unable to open debugger port (localhost:5005): java.net.ConnectException "Connection refused
// build.gradle.kts
//
// I have included:
// "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005"
// and 5005 port mapping
//
application {
mainClass.set("io.ktor.server.cio.EngineMain")
val isDevelopment: Boolean = project.ext.has("development")
applicationDefaultJvmArgs = listOf(
"-Dio.ktor.development=$isDevelopment",
"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005"
)
}
ktor {
docker {
// setup port mapping for the container/service
portMappings.set(listOf(
io.ktor.plugin.features.DockerPortMapping(
outsideDocker = 8080,
insideDocker = 8080,
io.ktor.plugin.features.DockerPortMappingProtocol.TCP
),
io.ktor.plugin.features.DockerPortMapping(
outsideDocker = 5005,
insideDocker = 5005,
io.ktor.plugin.features.DockerPortMappingProtocol.TCP
),
))
}
}
// application.yaml
ktor:
development: true
application:
modules:
- net.beoni.ktorunderalb.ApplicationKt.module
deployment:
port: 8080
autoreload: true
IDEA Run Cofiguration (jvm remote)