@@ -30,6 +30,7 @@ services:
3030 - JENKINS_SLAVE_AGENT_PORT=${JENKINS_SLAVE_AGENT_PORT}
3131 - JENKINS_JCASC_SECRETS_DIR=${JENKINS_JCASC_SECRETS_DIR}
3232 - JENKINS_AGENT_WORKSPACE_DIR=${JENKINS_AGENT_WORKSPACE_DIR}
33+ - JENKINS_AGENT_DOWNLOADS_DIR=${JENKINS_AGENT_DOWNLOADS_DIR}
3334 - JENKINS_DOCKER_AGENT_IMAGE_PATH=${JENKINS_DOCKER_AGENT_IMAGE_PATH}
3435 - JENKINS_AGENT_SHARED_METADATA_DIR=${JENKINS_AGENT_SHARED_METADATA_DIR}
3536 volumes :
@@ -95,10 +96,12 @@ services:
9596 # Mounting the tomcat_downloads folder containing the tomcat upgrade zip files
9697 # The zip file will be copied manually to the jenkins server
9798 # scp -r -i ~/.ssh/remote_servers_rsa_pri ~/Downloads/tomcat_downloads muhammad.faisal@172.31.0.73:/tmp
98- - /tmp/tomcat_downloads:${JENKINS_AGENT_WORKSPACE_DIR}/tomcat_downloads
99+ # But remember, if you recreate the /tmp/tomcat_downloads dir, the container won't see the new folder
100+ # until restarted => docker compose restart dind
101+ - /tmp/tomcat_downloads:${JENKINS_AGENT_DOWNLOADS_DIR}
99102 - ./certs/registry.crt:/usr/local/share/ca-certificates/registry.crt:ro
100103 # chown to ensure Jenkins agent can write to shared volume (owned by UID 1000, i.e. the Jenkins user)
101- command : sh -c "update-ca-certificates && chown -R 1000:1000 ${JENKINS_AGENT_WORKSPACE_DIR} ${JENKINS_AGENT_SHARED_METADATA_DIR} && dockerd-entrypoint.sh"
104+ command : sh -c "update-ca-certificates && chown -R 1000:1000 ${JENKINS_AGENT_DOWNLOADS_DIR} ${ JENKINS_AGENT_WORKSPACE_DIR} ${JENKINS_AGENT_SHARED_METADATA_DIR} && dockerd-entrypoint.sh"
102105 healthcheck :
103106 test : ["CMD", "sh", "-c", "docker version --format '{{.Server.Version}}' || exit 1"]
104107 interval : 5s
0 commit comments