Description of the issue: jib won't expose server.port in docker manifest file automatically, unless we write it in maven/gradle configuration file. If i change server.port in my application.properties file, I need to update my maven POM file too. I don't want to maintain a server port in both places.
Expected behavior: Jib is smart, it can find the MainClass as the ENTRYPOINT, I hope jib can be smart inferences server.port and expose it too.
Steps to reproduce:
If I don't write container.ports.port to 8888 in POM file, there will be no exposed port in docker image manifest file.
Sometimes even if i set it in POM file, it's still missing in the manifest file.
Environment:
Maven
jib-maven-plugin Configuration:
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>1.1.2</version>
<configuration>
<from>
<image>openjdk:8-jre-alpine</image>
</from>
<to>
<image>${docker.image.prefix}/${project.artifactId}</image>
</to>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>dockerBuild</goal>
</goals>
</execution>
</executions>
</plugin>
docker manifest config part without ExposedPorts:
{
"Config": {
"Hostname": "",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-1.8-openjdk/jre/bin:/usr/lib/jvm/java-1.8-openjdk/bin",
"JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk/jre",
"JAVA_VERSION=8u212",
"JAVA_ALPINE_VERSION=8.212.04-r0",
"LANG=C.UTF-8"
],
"Cmd": null,
"Image": "",
"Volumes": {},
"WorkingDir": "",
"Entrypoint": [
"java",
"-cp",
"/app/resources:/app/classes:/app/libs/*",
"com.example.helloservice.HelloServiceApplication"
],
"OnBuild": null,
"Labels": {}
}
}
this part is what i want to be included in Config or ContainerConfig section
"ExposedPorts": {
"8888/tcp": {}
}
Description of the issue: jib won't expose server.port in docker manifest file automatically, unless we write it in maven/gradle configuration file. If i change server.port in my application.properties file, I need to update my maven POM file too. I don't want to maintain a server port in both places.
Expected behavior: Jib is smart, it can find the MainClass as the ENTRYPOINT, I hope jib can be smart inferences server.port and expose it too.
Steps to reproduce:
If I don't write container.ports.port to 8888 in POM file, there will be no exposed port in docker image manifest file.
Sometimes even if i set it in POM file, it's still missing in the manifest file.
Environment:
Maven
jib-maven-pluginConfiguration:docker manifest config part without ExposedPorts:
{ "Config": { "Hostname": "", "Domainname": "", "User": "", "AttachStdin": false, "AttachStdout": false, "AttachStderr": false, "Tty": false, "OpenStdin": false, "StdinOnce": false, "Env": [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-1.8-openjdk/jre/bin:/usr/lib/jvm/java-1.8-openjdk/bin", "JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk/jre", "JAVA_VERSION=8u212", "JAVA_ALPINE_VERSION=8.212.04-r0", "LANG=C.UTF-8" ], "Cmd": null, "Image": "", "Volumes": {}, "WorkingDir": "", "Entrypoint": [ "java", "-cp", "/app/resources:/app/classes:/app/libs/*", "com.example.helloservice.HelloServiceApplication" ], "OnBuild": null, "Labels": {} } }this part is what i want to be included in Config or ContainerConfig section