From 145ff268dde1dd2e36cb889adc51a17f6b17095e Mon Sep 17 00:00:00 2001 From: "piotr.minkowski" Date: Thu, 22 Feb 2018 15:47:11 +0100 Subject: [PATCH] fix --- Dockerfile | 5 ++++- entrypoint.sh | 7 ++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 42666da..559cc3f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,8 @@ FROM docker:18-dind MAINTAINER Piotr Minkowski +ENV JENKINS_MASTER http://localhost:8080 +ENV JENKINS_SLAVE_NAME dind-node +ENV JENKINS_SLAVE_SECRET "" ENV JENKINS_HOME /home/jenkins ENV JENKINS_REMOTING_VERSION 3.17 ENV DOCKER_HOST tcp://0.0.0.0:2375 @@ -29,4 +32,4 @@ COPY entrypoint.sh /usr/local/bin/entrypoint VOLUME $JENKINS_HOME WORKDIR $JENKINS_HOME USER jenkins -ENTRYPOINT ["java", "-jar", "/usr/share/jenkins/slave.jar", "-jnlpUrl", "http://192.168.99.100:38080/computer/dind-node-1/slave-agent.jnlp", "-secret", "5664fe146104b89a1d2c78920fd9c5eebac3bd7344432e0668e366e2d3432d3e"] \ No newline at end of file +ENTRYPOINT ["/usr/local/bin/entrypoint"] \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index 1e67f48..a5a679e 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,7 +1,8 @@ #!/bin/sh set -e echo "starting dockerd..." -set -- sudo dockerd --host=unix:///var/run/docker.sock --host=tcp://0.0.0.0:2375 --storage-driver=vfs & +sudo dockerd --host=unix:///var/run/docker.sock --host=tcp://0.0.0.0:2375 --storage-driver=vfs & +echo "starting jnlp slave..." exec java -jar /usr/share/jenkins/slave.jar \ - -jnlpUrl http://192.168.99.100:38080/computer/dind-node-1/slave-agent.jnlp \ - -secret bee075f8fd9033ec7d89d7bf08e106d6e2588d278efc99ad19c4fb931a29108c "$@" \ No newline at end of file + -jnlpUrl $JENKINS_URL/computer/$JENKINS_SLAVE_NAME/slave-agent.jnlp \ + -secret $JENKINS_SLAVE_SECRET \ No newline at end of file