1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Dockerfileの中で、jenkins pluginを以下のように`install-plugin`していると、突然`WARN: install-plugins.sh is deprecated, please switch to jenkins-plugin-cli`と言われるケースの備忘録

1
Posted at

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.txt

This 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を使えるはず。おそらく。。

参考

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?