Skip to content

Instantly share code, notes, and snippets.

@msukanen
Created October 23, 2024 07:04
Show Gist options
  • Save msukanen/45143b20c52505cacf6a8665ce0bf861 to your computer and use it in GitHub Desktop.
Save msukanen/45143b20c52505cacf6a8665ce0bf861 to your computer and use it in GitHub Desktop.
docker + ktor + jib -- JDK-21 and how to sort out port setting.
ktor {
docker {
jreVersion.set(JavaVersion.VERSION_21)
portMappings.set(listOf(
io.ktor.plugin.features.DockerPortMapping(
15551, 15551,
io.ktor.plugin.features.DockerPortMappingProtocol.TCP
)
))
}
}
jib {
from {
image = "eclipse-temurin:21-jdk-alpine"
}
}
@msukanen
Copy link
Author

This is, if your app wants to listen to port 15551. Docker/ktor by default gives 8080 if not told otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment