diff --git a/taverna-docker-activity/src/main/java/org/apache/taverna/activities/docker/DockerContainerConfiguration.java b/taverna-docker-activity/src/main/java/org/apache/taverna/activities/docker/DockerContainerConfiguration.java
index bc1768b..2ca0648 100644
--- a/taverna-docker-activity/src/main/java/org/apache/taverna/activities/docker/DockerContainerConfiguration.java
+++ b/taverna-docker-activity/src/main/java/org/apache/taverna/activities/docker/DockerContainerConfiguration.java
@@ -20,6 +20,7 @@
 
 import com.github.dockerjava.api.model.ExposedPort;
 import com.github.dockerjava.api.model.Ports;
+import com.github.dockerjava.api.model.Volume;
 
 import java.util.Map;
 
@@ -75,8 +76,6 @@
 
     public static final String CMD = "cmd";
 
-    public static final String CMD_DELIMITER = ",";
-
     public static final String ENTRY_POINT = "entrypoint";
 
     /**
@@ -117,20 +116,60 @@
 
     public void setDockerRemoteConfig(DockerRemoteConfig dockerRemoteConfig);
 
+    public DockerRemoteConfig getDockerRemoteConfig();
+
     public Map<String, String> getInternalPropertyMap();
 
     public String getName();
 
     public String getImage();
 
-    public String[] getCmd();
-
-    public DockerRemoteConfig getDockerRemoteConfig();
-
     public ExposedPort[] getExposedPorts();
 
     public Ports.Binding[] getBindings();
 
-    //TODO add all remaining getters
+    public String getHostName();
+
+    public String getDomainName();
+
+    public String getUser();
+
+    public String getWorkingDir();
+
+    public String getMacAddress();
+
+    public String getStopSignal();
+
+    public String getIpv4Address();
+
+    public String getIpv6Address();
+
+    public boolean getAttachStdin();
+
+    public boolean getAttachStdout();
+
+    public boolean getAttachStderr();
+
+    public boolean getTty();
+
+    public boolean getStdinOpen();
+
+    public boolean getStdinOnce();
+
+    public boolean getNetworkDisabled();
+
+    public String[] getPortSpecs();
+
+    public String[] getEnv();
+
+    public String[] getEntryPoint();
+
+    public String[] getCmd();
+
+    public Volume[] getVolumes();
+
+    public String[] getAliases();
+
+    public Map<String, String> getLabels();
 
 }
diff --git a/taverna-docker-activity/src/main/java/org/apache/taverna/activities/docker/DockerContainerConfigurationImpl.java b/taverna-docker-activity/src/main/java/org/apache/taverna/activities/docker/DockerContainerConfigurationImpl.java
index 4e19713..ce5af23 100644
--- a/taverna-docker-activity/src/main/java/org/apache/taverna/activities/docker/DockerContainerConfigurationImpl.java
+++ b/taverna-docker-activity/src/main/java/org/apache/taverna/activities/docker/DockerContainerConfigurationImpl.java
@@ -27,6 +27,18 @@
 
     private DockerRemoteConfig dockerRemoteConfig;
 
+    private static final String ARR_DELIMITER = ",";
+
+    private static final String MAP_DELIMITER = ":";
+
+    private ExposedPort[] exposedPorts = null;
+
+    private Ports.Binding[] bindings = null;
+
+    private Volume[] volumes = null;
+
+    private Map<String, String> labels = null;
+
 
     public DockerContainerConfigurationImpl(ConfigurationManager configurationManager){
         super(configurationManager);
@@ -45,130 +57,162 @@
     }
 
     public String getName() {
-       return this.getInternalPropertyMap().get(NAME);
-    }
-
-    public String getHostName() {
-        return HOST_NAME;
-    }
-
-    public String getDomainName() {
-        return DOMAIN_NAME;
-    }
-
-    public String getUser() {
-        return USER;
+       return this.getInternalPropertyMap().get(NAME) != null? this.getInternalPropertyMap().get(NAME) : null;
     }
 
     public String getImage() {
-        return this.getInternalPropertyMap().get(IMAGE);
-    }
-
-    public String getWorkingDir() {
-        return WORKING_DIR;
-    }
-
-    public String getMacAddress() {
-        return MAC_ADDRESS;
-    }
-
-    public String getStopSignal() {
-        return STOP_SIGNAL;
-    }
-
-    public String getIpv4Address() {
-        return IPV4_ADDRESS;
-    }
-
-    public String getIpv6Address() {
-        return IPV6_ADDRESS;
-    }
-
-    public String getAttachStdin() {
-        return ATTACH_STDIN;
-    }
-
-    public String getAttachStdout() {
-        return ATTACH_STDOUT;
-    }
-
-    public String getAttachStderr() {
-        return ATTACH_STDERR;
-    }
-
-    public String getTty() {
-        return TTY;
-    }
-
-    public String getStdinOpen() {
-        return STDIN_OPEN;
-    }
-
-    public String getStdinOnce() {
-        return STDIN_ONCE;
-    }
-
-    public String getNetworkDisabled() {
-        return NETWORK_DISABLED;
-    }
-
-    public String getPortSpecs() {
-        return PORT_SPECS;
-    }
-
-    public String getEnv() {
-        return ENV;
-    }
-
-    public String[] getCmd() {
-        return this.getInternalPropertyMap().get(CMD).split(CMD_DELIMITER);
-    }
-
-    public String getEntryPoint() {
-        return ENTRY_POINT;
-    }
-
-    public String getVolumes() {
-        return VOLUMES;
-    }
-
-    public Ports.Binding[] getBindings() {
-       String bindingsStr = this.getInternalPropertyMap().get(BINDINGS);
-        List<Ports.Binding> bindingList = new ArrayList<Ports.Binding>();
-        if(bindingsStr != null) {
-            for(String bind : bindingsStr.split(",")){
-             bindingList.add(Ports.Binding.bindPort(Integer.valueOf(bind)));
-          }
-        }
-        return bindingList.toArray(new Ports.Binding[0]);
-    }
-
-    public String getAliases() {
-        return ALIASES;
+        return this.getInternalPropertyMap().get(IMAGE) != null?this.getInternalPropertyMap().get(IMAGE):null;
     }
 
     public ExposedPort[] getExposedPorts() {
-       String exposedPortStr =  this.getInternalPropertyMap().get(EXPOSED_PORTS);
-        List<ExposedPort> exposedPortList = new ArrayList<ExposedPort>();
-        if(exposedPortStr != null){
-            for(String portStr: exposedPortStr.split(",")){
-                exposedPortList.add(ExposedPort.tcp(Integer.valueOf(portStr)));
+        if(exposedPorts == null) {
+            String exposedPortStr = this.getInternalPropertyMap().get(EXPOSED_PORTS);
+            if(exposedPortStr == null){
+                return null;
+            }
+            List<ExposedPort> exposedPortList = new ArrayList<ExposedPort>();
+            if (exposedPortStr != null) {
+                for (String portStr : exposedPortStr.split(ARR_DELIMITER)) {
+                    exposedPortList.add(ExposedPort.tcp(Integer.valueOf(portStr)));
+                }
+            }
+           exposedPorts =  exposedPortList.toArray(new ExposedPort[0]);
+        }
+
+        return exposedPorts;
+    }
+
+    public Ports.Binding[] getBindings() {
+        if(bindings == null) {
+            String bindingsStr = this.getInternalPropertyMap().get(BINDINGS);
+            if(bindingsStr == null){
+                return null;
+            }
+            List<Ports.Binding> bindingList = new ArrayList<Ports.Binding>();
+            if (bindingsStr != null) {
+                for (String bind : bindingsStr.split(ARR_DELIMITER)) {
+                    bindingList.add(Ports.Binding.bindPort(Integer.valueOf(bind)));
+                }
+            }
+            bindings = bindingList.toArray(new Ports.Binding[0]);
+        }
+        return bindings;
+    }
+
+    public String getHostName() {
+        return this.getInternalPropertyMap().get(HOST_NAME);
+    }
+
+    public String getDomainName() {
+        return this.getInternalPropertyMap().get(DOMAIN_NAME);
+    }
+
+    public String getUser() {
+        return this.getInternalPropertyMap().get(USER);
+    }
+
+    public String getWorkingDir() {
+        return this.getInternalPropertyMap().get(WORKING_DIR);
+    }
+
+    public String getMacAddress() {
+        return this.getInternalPropertyMap().get(MAC_ADDRESS);
+    }
+
+    public String getStopSignal() {
+        return this.getInternalPropertyMap().get(STOP_SIGNAL);
+    }
+
+    public String getIpv4Address() {
+        return this.getInternalPropertyMap().get(IPV4_ADDRESS);
+    }
+
+    public String getIpv6Address() {
+        return this.getInternalPropertyMap().get(IPV6_ADDRESS);
+    }
+
+    public boolean getAttachStdin() {
+        return Boolean.parseBoolean(this.getInternalPropertyMap().get(ATTACH_STDIN));
+    }
+
+    public boolean getAttachStdout() {
+        return Boolean.parseBoolean(this.getInternalPropertyMap().get(ATTACH_STDOUT));
+    }
+
+    public boolean getAttachStderr() {
+        return Boolean.parseBoolean(this.getInternalPropertyMap().get(ATTACH_STDERR));
+    }
+
+    public boolean getTty() {
+        return Boolean.parseBoolean(this.getInternalPropertyMap().get(TTY));
+    }
+
+    public boolean getStdinOpen() {
+        return Boolean.parseBoolean(this.getInternalPropertyMap().get(STDIN_OPEN));
+    }
+
+    public boolean getStdinOnce() {
+        return Boolean.parseBoolean(this.getInternalPropertyMap().get(STDIN_ONCE));
+    }
+
+    public boolean getNetworkDisabled() {
+        return Boolean.parseBoolean(this.getInternalPropertyMap().get(NETWORK_DISABLED));
+    }
+
+    public String[] getPortSpecs() {
+        return this.getInternalPropertyMap().get(PORT_SPECS) != null ?
+                this.getInternalPropertyMap().get(PORT_SPECS).split(ARR_DELIMITER): null;
+    }
+
+    public String[] getEnv() {
+        return this.getInternalPropertyMap().get(ENV) != null ?
+                this.getInternalPropertyMap().get(ENV).split(ARR_DELIMITER):null;
+    }
+
+    public String[] getEntryPoint() {
+        return this.getInternalPropertyMap().get(ENTRY_POINT) != null ?
+                this.getInternalPropertyMap().get(ENTRY_POINT).split(ARR_DELIMITER):null;
+    }
+
+    public String[] getCmd() {
+        return this.getInternalPropertyMap().get(CMD) != null ?
+                this.getInternalPropertyMap().get(CMD).split(ARR_DELIMITER): null;
+    }
+
+    public Volume[] getVolumes() {
+        if(volumes == null) {
+            if(this.getInternalPropertyMap().get(VOLUMES) == null){
+                return null;
+            }
+            String[] arr = this.getInternalPropertyMap().get(VOLUMES).split(ARR_DELIMITER);
+            volumes = new Volume[arr.length];
+            for (int i = 0; i < arr.length; i++) {
+                volumes[i] = new Volume(arr[i]);
             }
         }
-        return exposedPortList.toArray(new ExposedPort[0]);
+        return volumes;
     }
 
-    public String getLabels() {
-        return LABELS;
+    public String[] getAliases() {
+        return this.getInternalPropertyMap().get(ALIASES) != null ?
+                this.getInternalPropertyMap().get(ALIASES).split(ARR_DELIMITER): null;
     }
 
-    public String getHostConfig() {
-        return HOST_CONFIG;
+    public Map<String, String> getLabels() {
+        if (labels == null) {
+            labels = new HashMap<>();
+            if(this.getInternalPropertyMap().get(LABELS) == null){
+                return null;
+            }
+            String[] entries = this.getInternalPropertyMap().get(LABELS).split(MAP_DELIMITER);
+            for (String entry : entries) {
+             String[] kv = entry.split(ARR_DELIMITER);
+                labels.put(kv[0], kv[1]);
+            }
+        }
+        return labels;
     }
 
-    public String getNetworkingConfig() {
-        return NETWORKING_CONFIG;
-    }
 
     @Override
     public Map<String, String> getDefaultPropertyMap() {
diff --git a/taverna-docker-activity/src/main/java/org/apache/taverna/activities/docker/RemoteClient.java b/taverna-docker-activity/src/main/java/org/apache/taverna/activities/docker/RemoteClient.java
index 43712c2..dc66cbd 100644
--- a/taverna-docker-activity/src/main/java/org/apache/taverna/activities/docker/RemoteClient.java
+++ b/taverna-docker-activity/src/main/java/org/apache/taverna/activities/docker/RemoteClient.java
@@ -125,14 +125,89 @@
 
     private CreateContainerCmd buildCreateContainerCmd(){
         CreateContainerCmd createCmd = dockerClient.createContainerCmd(containerConfig.getImage());
-        createCmd.withCmd(containerConfig.getCmd());
-        createCmd.withName(containerConfig.getName());
-        Ports portBindings = new Ports();
-        for(int i=0; i< containerConfig.getBindings().length; i++){
-            portBindings.bind(containerConfig.getExposedPorts()[i], containerConfig.getBindings()[i]);
+
+        if(containerConfig.getCmd() != null) {
+            createCmd.withCmd(containerConfig.getCmd());
         }
-        createCmd.withExposedPorts(containerConfig.getExposedPorts());
-        createCmd.withPortBindings(portBindings);
+
+        if(containerConfig.getName() != null) {
+            createCmd.withName(containerConfig.getName());
+        }
+
+        if(containerConfig.getBindings() != null && containerConfig.getExposedPorts() != null) {
+            Ports portBindings = new Ports();
+            for (int i = 0; i < containerConfig.getBindings().length; i++) {
+                portBindings.bind(containerConfig.getExposedPorts()[i], containerConfig.getBindings()[i]);
+            }
+            createCmd.withExposedPorts(containerConfig.getExposedPorts());
+            createCmd.withPortBindings(portBindings);
+        }
+
+        if(containerConfig.getHostName() != null) {
+            createCmd.withHostName(containerConfig.getHostName());
+        }
+
+        if(containerConfig.getDomainName() != null) {
+            createCmd.withDomainName(containerConfig.getDomainName());
+        }
+
+        if(containerConfig.getUser() != null) {
+            createCmd.withUser(containerConfig.getUser());
+        }
+
+        if(containerConfig.getWorkingDir() != null) {
+            createCmd.withWorkingDir(containerConfig.getWorkingDir());
+        }
+
+        if(containerConfig.getMacAddress() != null) {
+            createCmd.withMacAddress(containerConfig.getMacAddress());
+        }
+
+        if(containerConfig.getStopSignal() != null) {
+            createCmd.withStopSignal(containerConfig.getStopSignal());
+        }
+
+        if(containerConfig.getIpv4Address() != null) {
+            createCmd.withIpv4Address(containerConfig.getIpv4Address());
+        }
+
+        if(containerConfig.getIpv6Address() != null) {
+            createCmd.withIpv6Address(containerConfig.getIpv6Address());
+        }
+
+        createCmd.withAttachStdin(containerConfig.getAttachStdin());
+        createCmd.withAttachStdout(containerConfig.getAttachStdout());
+        createCmd.withAttachStderr(containerConfig.getAttachStderr());
+        createCmd.withTty(containerConfig.getTty());
+        createCmd.withStdInOnce(containerConfig.getStdinOnce());
+        createCmd.withStdinOpen(containerConfig.getStdinOpen());
+        createCmd.withNetworkDisabled(containerConfig.getNetworkDisabled());
+
+
+        if(containerConfig.getPortSpecs() != null) {
+            createCmd.withPortSpecs(containerConfig.getPortSpecs());
+        }
+
+        if(containerConfig.getEnv() != null) {
+            createCmd.withEnv(containerConfig.getEnv());
+        }
+
+        if(containerConfig.getEntryPoint() != null) {
+            createCmd.withEntrypoint(containerConfig.getEntryPoint());
+        }
+
+        if(containerConfig.getVolumes() != null) {
+            createCmd.withVolumes(containerConfig.getVolumes());
+        }
+
+        if(containerConfig.getAliases() != null) {
+            createCmd.withAliases(containerConfig.getAliases());
+        }
+
+        if(containerConfig.getLabels() != null) {
+            createCmd.withLabels(containerConfig.getLabels());
+        }
+        
         return createCmd;
     }
 
