Added jenkins slave agent port settings through the environmental variable JENKINS_SLAVE_AGENT_PORT
diff --git a/Dockerfile b/Dockerfile
index b22290b..f142acf 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -3,6 +3,7 @@
 RUN apt-get update && apt-get install -y wget git curl zip && rm -rf /var/lib/apt/lists/*
 
 ENV JENKINS_HOME /var/jenkins_home
+ENV JENKINS_SLAVE_AGENT_PORT 50000
 
 # Jenkins is ran with user `jenkins`, uid = 1000
 # If you bind mount a volume from host/volume from a data container, 
diff --git a/README.md b/README.md
index 02c0f59..b6aa5f3 100644
--- a/README.md
+++ b/README.md
@@ -99,6 +99,17 @@
 EXPOSE 8083
 ```
 
+You can also change the default slave agent port for jenkins by defining `JENKINS_SLAVE_AGENT_PORT` in a sample Dockerfile.
+
+```
+FROM jenkins:1.565.3
+ENV JENKINS_SLAVE_AGENT_PORT 50001
+```
+or as a parameter to docker,
+```
+docker run --name myjenkins -p 8080:8080 -p 50001:50001 --env JENKINS_SLAVE_AGENT_PORT=50001 jenkins
+```
+
 # Installing more tools
 
 You can run your container as root - and install via apt-get, install as part of build steps via jenkins tool installers, or you can create your own Dockerfile to customise, for example: 
diff --git a/init.groovy b/init.groovy
index a42a733..2f9f129 100644
--- a/init.groovy
+++ b/init.groovy
@@ -5,6 +5,6 @@
 Thread.start {
       sleep 10000
       println "--> setting agent port for jnlp"
-      Jenkins.instance.setSlaveAgentPort(50000)
+      Jenkins.instance.setSlaveAgentPort(env['JENKINS_SLAVE_AGENT_PORT'])
       println "--> setting agent port for jnlp... done"
 }