jib
jib copied to clipboard
Jib CLI proxy usage not documented
There is no documentation that we can configure JVM options (You can also use JAVA_OPTS and JIB_OPTS to pass JVM options) for jib cli. That's needed when we want to configure proxy that will be used by jib-core under the hood. But as soon there is a plan to make jib cli native executable it will be better to add proxy options as a cli parameters.
Configure http proxy to use by jib cli:
JIB_OPTS: >-
-Dhttp.proxyHost=$PROXY_HOST
-Dhttp.proxyPort=$PROXY_PORT
-Dhttps.proxyHost=$PROXY_HOST
-Dhttps.proxyPort=$PROXY_PORT
-Dhttp.nonProxyHosts=$NO_PROXY
Thanks for bringing this up! We have some documentation to set jvm-flags through the --jvm-flags option in the jib CLI jar command and to customize environment variables if using the jib cli build command (https://github.com/GoogleContainerTools/jib/blob/6df635ee51bc466c961cdeea23d84e84e87ba4b0/jib-cli/README.md#fully-annotated-build-file-jibyaml) which can be used to set JAVA_TOOL_OPTIONS. However, there may be an opportunity to clarify this a bit more in our FAQ entry
@mpeddada1 My use case is following: I have restricted environment where is access to the public Internet available only via proxy. I'm using "jib build" command and base image have to be downloaded from the dockerhub central. I cannot use environment variables in jib.yaml for such scenario. Therefore I need to open script file and realize that I can pass jvm parameters using JIB_OPTS (inside script You can also use JAVA_OPTS and JIB_OPTS to pass JVM options to this script.). And moreover, before that I have to know that inside jib-core it's using jvm networking properties
@scrat98 did the documentation @mpeddada1 shared cover your use case? Looks like this could be a more specific situation we can cover in the docs. If you found a solution, please share it here so we can make the update.
Hello @diegomarquezp . The documentation @mpeddada1 shared is about JVM flags for the application's entrypoint.
However, my question is about the JVM flags for the Jib process itself (the process that builds the application). Have a look at PR https://github.com/GoogleContainerTools/jib/pull/4430