Open jackjia-ibm opened 5 years ago
I'm gonna bump this question as well, I ran into the same issue. Here are the logs of the service starting :
docker service logs agt-_of_test_dind_8-243
agt-_of_test_dind_8-243.1.0sg6tr7chgwy@VMNLDEV | + docker run --rm --privileged my-repo:5100/jenkins-slave-dind:latest sh -xc printenv && curl --connect-timeout 20 --max-time 60 -o agent.jar $DOCKER_SWARM_PLUGIN_JENKINS_AGENT_JAR_URL && java -jar agent.jar -jnlpUrl $DOCKER_SWARM_PLUGIN_JENKINS_AGENT_JNLP_URL -secret $DOCKER_SWARM_PLUGIN_JENKINS_AGENT_SECRET -noReconnect -workDir /tmp
agt-_of_test_dind_8-243.1.0sg6tr7chgwy@VMNLDEV | Unable to find image 'my-repo:5100/jenkins-slave-dind:latest' locally
agt-_of_test_dind_8-243.1.0sg6tr7chgwy@VMNLDEV | latest: Pulling from jenkins-slave-dind
agt-_of_test_dind_8-243.1.0sg6tr7chgwy@VMNLDEV | df20fa9351a1: Already exists
agt-_of_test_dind_8-243.1.0sg6tr7chgwy@VMNLDEV | 25ad7478873d: Already exists
agt-_of_test_dind_8-243.1.0sg6tr7chgwy@VMNLDEV | 4684f6177b5d: Already exists
agt-_of_test_dind_8-243.1.0sg6tr7chgwy@VMNLDEV | 46e300cec669: Already exists
agt-_of_test_dind_8-243.1.0sg6tr7chgwy@VMNLDEV | 63038576ad94: Already exists
agt-_of_test_dind_8-243.1.0sg6tr7chgwy@VMNLDEV | 0fdb76c4706c: Already exists
agt-_of_test_dind_8-243.1.0sg6tr7chgwy@VMNLDEV | cb7edeffdfd5: Already exists
agt-_of_test_dind_8-243.1.0sg6tr7chgwy@VMNLDEV | cc28bd76800f: Already exists
agt-_of_test_dind_8-243.1.0sg6tr7chgwy@VMNLDEV | 54196fe38f7e: Already exists
agt-_of_test_dind_8-243.1.0sg6tr7chgwy@VMNLDEV | ea71acc29633: Already exists
agt-_of_test_dind_8-243.1.0sg6tr7chgwy@VMNLDEV | 657cc4c15165: Already exists
agt-_of_test_dind_8-243.1.0sg6tr7chgwy@VMNLDEV | 029a8e2f0ec8: Pulling fs layer
agt-_of_test_dind_8-243.1.0sg6tr7chgwy@VMNLDEV | 029a8e2f0ec8: Verifying Checksum
agt-_of_test_dind_8-243.1.0sg6tr7chgwy@VMNLDEV | 029a8e2f0ec8: Download complete
agt-_of_test_dind_8-243.1.0sg6tr7chgwy@VMNLDEV | 029a8e2f0ec8: Pull complete
agt-_of_test_dind_8-243.1.0sg6tr7chgwy@VMNLDEV | Digest: sha256:905b52e263926bbe7ff696660f3232d2aae874baf95ccb611af1bbc91da98932
agt-_of_test_dind_8-243.1.0sg6tr7chgwy@VMNLDEV | Status: Downloaded newer image for my-repo:5100/jenkins-slave-dind:latest
agt-_of_test_dind_8-243.1.0sg6tr7chgwy@VMNLDEV | + printenv
agt-_of_test_dind_8-243.1.0sg6tr7chgwy@VMNLDEV | HOSTNAME=61f9af78bf9d
agt-_of_test_dind_8-243.1.0sg6tr7chgwy@VMNLDEV | SHLVL=3
agt-_of_test_dind_8-243.1.0sg6tr7chgwy@VMNLDEV | HOME=/root
agt-_of_test_dind_8-243.1.0sg6tr7chgwy@VMNLDEV | LC_CTYPE=en_US.UTF-8
agt-_of_test_dind_8-243.1.0sg6tr7chgwy@VMNLDEV | DIND_COMMIT=ed89041433a031cafc0a0f19cfe573c31688d377
agt-_of_test_dind_8-243.1.0sg6tr7chgwy@VMNLDEV | PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
agt-_of_test_dind_8-243.1.0sg6tr7chgwy@VMNLDEV | DOCKER_CHANNEL=stable
agt-_of_test_dind_8-243.1.0sg6tr7chgwy@VMNLDEV | DOCKER_VERSION=19.03.12
agt-_of_test_dind_8-243.1.0sg6tr7chgwy@VMNLDEV | DOCKER_TLS_CERTDIR=/certs
agt-_of_test_dind_8-243.1.0sg6tr7chgwy@VMNLDEV | DOCKER_HOST=tcp://docker:2375
agt-_of_test_dind_8-243.1.0sg6tr7chgwy@VMNLDEV | PWD=/
agt-_of_test_dind_8-243.1.0sg6tr7chgwy@VMNLDEV | + curl --connect-timeout 20 --max-time 60 -o agent.jar
agt-_of_test_dind_8-243.1.0sg6tr7chgwy@VMNLDEV | curl: no URL specified!
agt-_of_test_dind_8-243.1.0sg6tr7chgwy@VMNLDEV | curl: try 'curl --help' or 'curl --manual' for more information
A printenv
in the startup command can confirm there is no docker swarm plugin variables.
I tried to use the trick to name a dind label to create privileged container, but found the container loses environment variables, like DOCKER_SWARM_PLUGIN_JENKINS_AGENT_SECRET, DOCKER_SWARM_PLUGIN_JENKINS_AGENT_JAR_URL and DOCKER_SWARM_PLUGIN_JENKINS_AGENT_JNLP_URL.
It related to the command rendered from here: https://github.com/jenkinsci/docker-swarm-plugin/blob/master/src/main/java/org/jenkinsci/plugins/docker/swarm/DockerSwarmComputerLauncher.java#L155
I'm not sure if I configured wrongly or this is an issue can be fixed. Please advice, thanks!