我正在将Docker映像设置为JNLP从站。这是没有自定义的静态从站。我的Docker文件是:
FROM <my-repo>/build/openjdk:latest
ARG master
ENV JENKINS_MASTER_URL=$master
ENV HOME /home/jenkins
RUN mkdir -p /usr/share/jenkins && chmod 755 /usr/share/jenkins
COPY slave.jar /usr/share/jenkins/slave.jar
USER jenkins
RUN mkdir $HOME/.jenkins
VOLUME $HOME/.jenkins
WORKDIR $HOME
CMD ["sh", "-c", "java -jar /usr/share/jenkins/slave.jar -jnlpUrl $JENKINS_MASTER_URL"]
我使用
构建图像docker build -t slave:0.4 . --build-arg masterurl='http://<URL-OF_JK-MASTER>'
但是它给出了一个错误:
[Fatal Error] test.com:6:3: The element type "hr" must be terminated by the matching end-tag "</hr>".
Failing to obtain http://<URL-OF_JK-MASTER>
java.io.IOException: http://<URL-OF_JK-MASTER> doesn't look like a JNLP file; content type was text/html
at hudson.remoting.Launcher.parseJnlpArguments(Launcher.java:525)
at hudson.remoting.Launcher.run(Launcher.java:322)
at hudson.remoting.Launcher.main(Launcher.java:283)
Waiting 10 seconds before retry
[Fatal Error] test.com:6:3: The element type "hr" must be terminated by the matching end-tag "</hr>".
Failing to obtain http://<URL-OF_JK-MASTER>
java.io.IOException: http://<URL-OF_JK-MASTER> doesn't look like a JNLP file; content type was text/html
at hudson.remoting.Launcher.parseJnlpArguments(Launcher.java:525)
at hudson.remoting.Launcher.run(Launcher.java:322)
at hudson.remoting.Launcher.main(Launcher.java:283)
我不确定为什么不使用我的Jenkins主网址。关于我缺少的任何想法吗?