Dockerfileの中で、jenkins pluginを以下のようにinstall-pluginしていると、突然WARN: install-plugins.sh is deprecated, please switch to jenkins-plugin-cliと言われるケースの備忘録
例えば以下のようなものをさす
https://github.com/jenkinsci/docker/issues/1005
I am building own jenkins images with preinstalled plugins. In my Dockerfile, I used to execute the install-plugins.sh shellscript like this:COPY ./plugins.txt /usr/share/jenkins/ref/plugins.txt RUN /usr/local/bin/install-plugins.sh < >/usr/share/jenkins/ref/plugins.txtThis works perfectly, but since some weeks, I warns me because of >deprecation:
WARN: install-plugins.sh is deprecated, please switch to jenkins->plugin-cli
This is why I wanted to switch to jenkins-plugin-cli today, so I >changed my Dockerfile:COPY ./plugins.txt /usr/share/jenkins/ref/plugins.txt RUN jenkins-plugin-cli --verbose -f >/usr/share/jenkins/ref/plugins.txt
WARN: install-plugins.sh is deprecated, please switch to jenkins->plugin-cliの通りjenkins->plugin-cliを使おうとすると、
どうやらI do not see any requests go to my proxyとなる様子
Created cache at: /root/.cache/jenkins-plugin-management-cli
Cache miss for: update-center-2.263
io.jenkins.tools.pluginmanager.impl.UpdateCenterInfoRetrievalException: Error getting update center json
I do not see any requests go to my proxy, so I guess that the jenkins-plugin-cli simply does not care about my http_proxy/https_proxy environment variables (which are used by the old, deprecated script).
この場合は、
以下のようにARG _JAVA_OPTIONSに"-Dhttps.proxyHost=myproxy -Dhttps.proxyPort=myport"のようにオプションを渡せばOKの様子
(myproxyはプロキシサーバのホスト名(ex:proxy.xx.xx)、myportはポート(ex:8080))
ARG _JAVA_OPTIONS inside of your dockerfile
pass "-Dhttps.proxyHost=myproxy -Dhttps.proxyPort=myport"
ENV _JAVA_OPTIONS "-Dhttps.proxyHost=myproxy -Dhttps.proxyPort=myport"
RUN jenkins-plugin-cli -f "/var/jenkins_home/plugins.txt"
これでproxy経由でjenkins-plugin-cliを使えるはず。おそらく。。
参考