Allow passing extra java opts and proxy env

Change-Id: I4b0350c24ff461a9c08c71ee587dd08570ce2929
diff --git a/docker/swarm/stack/jenkins/slave.yml b/docker/swarm/stack/jenkins/slave.yml
index fc281b7..12a14d4 100644
--- a/docker/swarm/stack/jenkins/slave.yml
+++ b/docker/swarm/stack/jenkins/slave.yml
@@ -1,3 +1,5 @@
+classes:
+- system.docker
 parameters:
   _param:
     docker_image_jenkins_slave: tcpcloud/jnlp-slave
@@ -7,6 +9,7 @@
     jenkins_master_url: http://${_param:jenkins_master_host}:${_param:jenkins_master_port}
     jenkins_slave_user: ${_param:jenkins_client_user}
     jenkins_slave_password: ${_param:jenkins_client_password}
+    jenkins_slave_extra_opts: ""
   docker:
     client:
       stack:
@@ -19,6 +22,10 @@
                 JENKINS_UPDATE_SLAVE: 'true'
                 JENKINS_LOGIN: ${_param:jenkins_slave_user}
                 JENKINS_PASSWORD: ${_param:jenkins_slave_password}
+                JAVA_OPTS: ${_param:jenkins_slave_extra_opts}
+                https_proxy: ${_param:docker_https_proxy}
+                http_proxy: ${_param:docker_http_proxy}
+                no_proxy: ${_param:docker_no_proxy}
               deploy:
                 restart_policy:
                   condition: any
@@ -39,6 +46,10 @@
                 JENKINS_UPDATE_SLAVE: 'true'
                 JENKINS_LOGIN: ${_param:jenkins_slave_user}
                 JENKINS_PASSWORD: ${_param:jenkins_slave_password}
+                JAVA_OPTS: ${_param:jenkins_slave_extra_opts}
+                https_proxy: ${_param:docker_https_proxy}
+                http_proxy: ${_param:docker_http_proxy}
+                no_proxy: ${_param:docker_no_proxy}
               deploy:
                 restart_policy:
                   condition: any
@@ -59,6 +70,10 @@
                 JENKINS_UPDATE_SLAVE: 'true'
                 JENKINS_LOGIN: ${_param:jenkins_slave_user}
                 JENKINS_PASSWORD: ${_param:jenkins_slave_password}
+                JAVA_OPTS: ${_param:jenkins_slave_extra_opts}
+                https_proxy: ${_param:docker_https_proxy}
+                http_proxy: ${_param:docker_http_proxy}
+                no_proxy: ${_param:docker_no_proxy}
               deploy:
                 restart_policy:
                   condition: any