Repository: docker-java/docker-java
Pull request #121 (2015-01-10 12:06:32)

Implemented support for commands: Exec-start, Exec-create.
Created tests are passed.


Patch:
diff --git a/src/main/java/com/github/dockerjava/api/DockerClient.java b/src/main/java/com/github/dockerjava/api/DockerClient.java
index 4052e87b..53b21260 100644
--- a/src/main/java/com/github/dockerjava/api/DockerClient.java
+++ b/src/main/java/com/github/dockerjava/api/DockerClient.java
@@ -2,38 +2,7 @@ package com.github.dockerjava.api;
 
 import java.io.*;
 
-import com.github.dockerjava.api.command.AttachContainerCmd;
-import com.github.dockerjava.api.command.AuthCmd;
-import com.github.dockerjava.api.command.BuildImageCmd;
-import com.github.dockerjava.api.command.CommitCmd;
-import com.github.dockerjava.api.command.ContainerDiffCmd;
-import com.github.dockerjava.api.command.CopyFileFromContainerCmd;
-import com.github.dockerjava.api.command.CreateContainerCmd;
-import com.github.dockerjava.api.command.CreateImageCmd;
-import com.github.dockerjava.api.command.EventCallback;
-import com.github.dockerjava.api.command.EventsCmd;
-import com.github.dockerjava.api.command.InfoCmd;
-import com.github.dockerjava.api.command.InspectContainerCmd;
-import com.github.dockerjava.api.command.InspectImageCmd;
-import com.github.dockerjava.api.command.KillContainerCmd;
-import com.github.dockerjava.api.command.ListContainersCmd;
-import com.github.dockerjava.api.command.ListImagesCmd;
-import com.github.dockerjava.api.command.LogContainerCmd;
-import com.github.dockerjava.api.command.PauseContainerCmd;
-import com.github.dockerjava.api.command.PingCmd;
-import com.github.dockerjava.api.command.PullImageCmd;
-import com.github.dockerjava.api.command.PushImageCmd;
-import com.github.dockerjava.api.command.RemoveContainerCmd;
-import com.github.dockerjava.api.command.RemoveImageCmd;
-import com.github.dockerjava.api.command.RestartContainerCmd;
-import com.github.dockerjava.api.command.SearchImagesCmd;
-import com.github.dockerjava.api.command.StartContainerCmd;
-import com.github.dockerjava.api.command.StopContainerCmd;
-import com.github.dockerjava.api.command.TagImageCmd;
-import com.github.dockerjava.api.command.TopContainerCmd;
-import com.github.dockerjava.api.command.UnpauseContainerCmd;
-import com.github.dockerjava.api.command.VersionCmd;
-import com.github.dockerjava.api.command.WaitContainerCmd;
+import com.github.dockerjava.api.command.*;
 import com.github.dockerjava.api.model.AuthConfig;
 
 // https://godoc.org/github.com/fsouza/go-dockerclient
@@ -95,6 +64,8 @@ public interface DockerClient extends Closeable {
 	 */
 	public StartContainerCmd startContainerCmd(String containerId);
 
+    public ExecCreateCmd execCreateCmd(String containerId);
+
 	public InspectContainerCmd inspectContainerCmd(String containerId);
 
 	public RemoveContainerCmd removeContainerCmd(String containerId);
@@ -103,6 +74,8 @@ public interface DockerClient extends Closeable {
 
 	public AttachContainerCmd attachContainerCmd(String containerId);
 
+    public ExecStartCmd execStartCmd(String containerId);
+
 	public LogContainerCmd logContainerCmd(String containerId);
 
 	public CopyFileFromContainerCmd copyFileFromContainerCmd(
diff --git a/src/main/java/com/github/dockerjava/api/command/CreateContainerCmd.java b/src/main/java/com/github/dockerjava/api/command/CreateContainerCmd.java
index 2eeda23e..1cf3098e 100644
--- a/src/main/java/com/github/dockerjava/api/command/CreateContainerCmd.java
+++ b/src/main/java/com/github/dockerjava/api/command/CreateContainerCmd.java
@@ -120,12 +120,7 @@ public interface CreateContainerCmd extends DockerCmd<CreateContainerResponse>{
 	 * prevents the container from changing the owner of any files.
 	 */
 	public CreateContainerCmd withCapDrop(Capability... capDrop);
-	
-	
-	public String[] getEntrypoint();
-	
-	public CreateContainerCmd withEntrypoint(String... entrypoint);
-	
+
 	/**
 	 * @throws NotFoundException No such container
 	 * @throws ConflictException Named container already exists
diff --git a/src/main/java/com/github/dockerjava/api/command/DockerCmdExecFactory.java b/src/main/java/com/github/dockerjava/api/command/DockerCmdExecFactory.java
index 24c0a465..df26743e 100644
--- a/src/main/java/com/github/dockerjava/api/command/DockerCmdExecFactory.java
+++ b/src/main/java/com/github/dockerjava/api/command/DockerCmdExecFactory.java
@@ -15,6 +15,8 @@ public interface DockerCmdExecFactory extends Closeable {
 
 	public PingCmd.Exec createPingCmdExec();
 
+    public ExecCreateCmd.Exec createExecCmdExec();
+
 	public VersionCmd.Exec createVersionCmdExec();
 
 	public PullImageCmd.Exec createPullImageCmdExec();
@@ -45,6 +47,8 @@ public interface DockerCmdExecFactory extends Closeable {
 
 	public AttachContainerCmd.Exec createAttachContainerCmdExec();
 
+    public ExecStartCmd.Exec createExecStartCmdExec();
+
 	public LogContainerCmd.Exec createLogContainerCmdExec();
 
 	public CopyFileFromContainerCmd.Exec createCopyFileFromContainerCmdExec();
diff --git a/src/main/java/com/github/dockerjava/api/command/ExecCreateCmd.java b/src/main/java/com/github/dockerjava/api/command/ExecCreateCmd.java
new file mode 100644
index 00000000..e71fb04e
--- /dev/null
+++ b/src/main/java/com/github/dockerjava/api/command/ExecCreateCmd.java
@@ -0,0 +1,19 @@
+package com.github.dockerjava.api.command;
+
+public interface ExecCreateCmd extends DockerCmd<ExecCreateCmdResponse> {
+
+    public String getContainerId();
+
+    public ExecCreateCmd withCmd(String... cmd);
+
+    public ExecCreateCmd attachStdin(boolean attachStdin);
+
+    public ExecCreateCmd attachStdout(boolean attachStdout);
+
+    public ExecCreateCmd attachStderr(boolean attachStderr);
+
+    public ExecCreateCmd tty(boolean tty);
+
+    public static interface Exec extends DockerCmdExec<ExecCreateCmd, ExecCreateCmdResponse> {
+    }
+}
diff --git a/src/main/java/com/github/dockerjava/api/command/ExecCreateCmdResponse.java b/src/main/java/com/github/dockerjava/api/command/ExecCreateCmdResponse.java
new file mode 100644
index 00000000..391625cf
--- /dev/null
+++ b/src/main/java/com/github/dockerjava/api/command/ExecCreateCmdResponse.java
@@ -0,0 +1,15 @@
+package com.github.dockerjava.api.command;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class ExecCreateCmdResponse {
+
+    @JsonProperty("Id")
+    private String id;
+
+    public String getId() {
+        return id;
+    }
+}
diff --git a/src/main/java/com/github/dockerjava/api/command/ExecStartCmd.java b/src/main/java/com/github/dockerjava/api/command/ExecStartCmd.java
new file mode 100644
index 00000000..8f6fff7b
--- /dev/null
+++ b/src/main/java/com/github/dockerjava/api/command/ExecStartCmd.java
@@ -0,0 +1,22 @@
+package com.github.dockerjava.api.command;
+
+import com.github.dockerjava.api.NotFoundException;
+
+import java.io.InputStream;
+
+public interface ExecStartCmd extends DockerCmd<InputStream>{
+
+    public String getContainerId();
+
+    public boolean isDetach();
+
+    public boolean isTty();
+
+    /**
+     * @throws com.github.dockerjava.api.NotFoundException No such container
+     */
+    @Override
+    public InputStream exec() throws NotFoundException;
+
+    public static interface Exec extends DockerCmdExec<ExecStartCmd, InputStream> {}
+}
diff --git a/src/main/java/com/github/dockerjava/core/DockerClientConfig.java b/src/main/java/com/github/dockerjava/core/DockerClientConfig.java
index 8506d437..db27940a 100644
--- a/src/main/java/com/github/dockerjava/core/DockerClientConfig.java
+++ b/src/main/java/com/github/dockerjava/core/DockerClientConfig.java
@@ -1,9 +1,5 @@
 package com.github.dockerjava.core;
 
-import com.github.dockerjava.api.DockerClientException;
-import com.github.dockerjava.api.model.AuthConfig;
-import com.github.dockerjava.core.NameParser.HostnameReposName;
-import com.github.dockerjava.core.NameParser.ReposTag;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
 
@@ -16,10 +12,7 @@ import java.util.Map;
 import java.util.Properties;
 
 public class DockerClientConfig implements Serializable {
-
-	private static final long serialVersionUID = -4307357472441531489L;
-	
-	private static final String DOCKER_HOST_PROPERTY = "DOCKER_HOST";
+    private static final String DOCKER_HOST_PROPERTY = "DOCKER_HOST";
     private static final String DOCKER_CERT_PATH_PROPERTY = "DOCKER_CERT_PATH";
     private static final String DOCKER_IO_URL_PROPERTY = "docker.io.url";
     private static final String DOCKER_IO_VERSION_PROPERTY = "docker.io.version";
@@ -228,47 +221,6 @@ public class DockerClientConfig implements Serializable {
     public String getDockerCfgPath() {
         return dockerCfgPath;
     }
-    
-    private AuthConfig getAuthConfig() {
-    	AuthConfig authConfig = null;
-    	if(getUsername() != null) {
-    		authConfig = new AuthConfig();
-    		authConfig.setUsername(getUsername());
-    		authConfig.setPassword(getPassword());
-    		authConfig.setEmail(getEmail());
-    		authConfig.setServerAddress(getServerAddress());
-    	} 
-    	return authConfig;
-    }
-    
-    public AuthConfig effectiveAuthConfig(String imageName) {
-		AuthConfig authConfig = null;
-
-		String dockerCfgFile = getDockerCfgPath();
-
-		if (dockerCfgFile != null && imageName != null) {
-			AuthConfigFile authConfigFile;
-			try {
-				authConfigFile = AuthConfigFile.loadConfig(new File(
-						dockerCfgFile));
-			} catch (IOException e) {
-				throw new DockerClientException(
-						"Failed to parse dockerCfgFile", e);
-			}
-			ReposTag reposTag = NameParser.parseRepositoryTag(imageName);
-			HostnameReposName hostnameReposName = NameParser
-					.resolveRepositoryName(reposTag.repos);
-			
-			authConfig = authConfigFile
-					.resolveAuthConfig(hostnameReposName.hostname);	
-		}
-		
-		AuthConfig _authConfig = getAuthConfig();
-		
-		if(_authConfig != null) authConfig = _authConfig;
-		
-		return authConfig;
-	}
 
   @Override
     public boolean equals(Object o) {
diff --git a/src/main/java/com/github/dockerjava/core/DockerClientImpl.java b/src/main/java/com/github/dockerjava/core/DockerClientImpl.java
index 09fafd9e..1a06c2d5 100644
--- a/src/main/java/com/github/dockerjava/core/DockerClientImpl.java
+++ b/src/main/java/com/github/dockerjava/core/DockerClientImpl.java
@@ -18,14 +18,14 @@ import com.google.common.base.Preconditions;
 
 /**
  * @author Konstantin Pelykh (kpelykh@gmail.com)
- * 
+ *
  * @see https://github.com/docker/docker/blob/master/api/client/commands.go
  */
 public class DockerClientImpl implements Closeable, DockerClient {
 
-	private final DockerClientConfig dockerClientConfig;
+    private final DockerClientConfig dockerClientConfig;
 
-	private DockerCmdExecFactory dockerCmdExecFactory;
+    private DockerCmdExecFactory dockerCmdExecFactory;
 
 	private DockerClientImpl() {
 		this(DockerClientConfig.createDefaultConfigBuilder().build());
@@ -35,57 +35,53 @@ public class DockerClientImpl implements Closeable, DockerClient {
 		this(configWithServerUrl(serverUrl));
 	}
 
-	private DockerClientImpl(DockerClientConfig dockerClientConfig) {
-		Preconditions.checkNotNull(dockerClientConfig,
-				"config was not specified");
-		this.dockerClientConfig = dockerClientConfig;
-	}
+    private  DockerClientImpl(DockerClientConfig dockerClientConfig) {
+    	Preconditions.checkNotNull(dockerClientConfig, "config was not specified");
+        this.dockerClientConfig = dockerClientConfig;
+    }
 
-	private static DockerClientConfig configWithServerUrl(String serverUrl) {
+    private static DockerClientConfig configWithServerUrl(String serverUrl) {
 		return DockerClientConfig.createDefaultConfigBuilder()
-				.withUri(serverUrl).build();
+                .withUri(serverUrl)
+                .build();
 	}
 
-	public static DockerClientImpl getInstance() {
-		return new DockerClientImpl();
-	}
+    public static DockerClientImpl getInstance() {
+    	return new DockerClientImpl();
+    }
 
-	public static DockerClientImpl getInstance(
-			DockerClientConfig dockerClientConfig) {
-		return new DockerClientImpl(dockerClientConfig);
-	}
+    public static DockerClientImpl getInstance(DockerClientConfig dockerClientConfig) {
+    	return new DockerClientImpl(dockerClientConfig);
+    }
 
-	public static DockerClientImpl getInstance(String serverUrl) {
-		return new DockerClientImpl(serverUrl);
-	}
+    public static DockerClientImpl getInstance(String serverUrl) {
+    	return new DockerClientImpl(serverUrl);
+    }
 
-	public DockerClientImpl withDockerCmdExecFactory(
-			DockerCmdExecFactory dockerCmdExecFactory) {
-		Preconditions.checkNotNull(dockerCmdExecFactory,
-				"dockerCmdExecFactory was not specified");
+    public DockerClientImpl withDockerCmdExecFactory(
+    		DockerCmdExecFactory dockerCmdExecFactory) {
+    	Preconditions.checkNotNull(dockerCmdExecFactory, "dockerCmdExecFactory was not specified");
 		this.dockerCmdExecFactory = dockerCmdExecFactory;
 		this.dockerCmdExecFactory.init(dockerClientConfig);
 		return this;
 	}
 
 	private DockerCmdExecFactory getDockerCmdExecFactory() {
-		Preconditions.checkNotNull(dockerCmdExecFactory,
-				"dockerCmdExecFactory was not specified");
+		Preconditions.checkNotNull(dockerCmdExecFactory, "dockerCmdExecFactory was not specified");
 		return dockerCmdExecFactory;
 	}
 
-	@Override
-	public AuthConfig authConfig() {
-		checkNotNull(dockerClientConfig.getUsername(),
-				"Configured username is null.");
-		checkNotNull(dockerClientConfig.getServerAddress(),
-				"Configured serverAddress is null.");
-
-		AuthConfig authConfig = new AuthConfig();
-		authConfig.setUsername(dockerClientConfig.getUsername());
-		authConfig.setPassword(dockerClientConfig.getPassword());
-		authConfig.setEmail(dockerClientConfig.getEmail());
-		authConfig.setServerAddress(dockerClientConfig.getServerAddress());
+
+    @Override
+    public AuthConfig authConfig() {
+        checkNotNull(dockerClientConfig.getUsername(), "Configured username is null.");
+        checkNotNull(dockerClientConfig.getServerAddress(), "Configured serverAddress is null.");
+
+        AuthConfig authConfig = new AuthConfig();
+        authConfig.setUsername(dockerClientConfig.getUsername());
+        authConfig.setPassword(dockerClientConfig.getPassword());
+        authConfig.setEmail(dockerClientConfig.getEmail());
+        authConfig.setServerAddress(dockerClientConfig.getServerAddress());
 
 		return authConfig;
 	}
@@ -99,8 +95,7 @@ public class DockerClientImpl implements Closeable, DockerClient {
 	 */
 	@Override
 	public AuthCmd authCmd() {
-		return new AuthCmdImpl(getDockerCmdExecFactory().createAuthCmdExec(),
-				authConfig());
+		return new AuthCmdImpl(getDockerCmdExecFactory().createAuthCmdExec(), authConfig());
 	}
 
 	@Override
@@ -110,59 +105,68 @@ public class DockerClientImpl implements Closeable, DockerClient {
 
 	@Override
 	public PingCmd pingCmd() {
-		return new PingCmdImpl(getDockerCmdExecFactory().createPingCmdExec());
+	    return new PingCmdImpl(getDockerCmdExecFactory().createPingCmdExec());
 	}
 
 	@Override
 	public VersionCmd versionCmd() {
-		return new VersionCmdImpl(getDockerCmdExecFactory()
-				.createVersionCmdExec());
+		return new VersionCmdImpl(getDockerCmdExecFactory().createVersionCmdExec());
 	}
 
 	/**
 	 * * IMAGE API *
 	 */
+
 	@Override
 	public PullImageCmd pullImageCmd(String repository) {
-		return new PullImageCmdImpl(getDockerCmdExecFactory()
-				.createPullImageCmdExec(), repository).withAuthConfig(dockerClientConfig.effectiveAuthConfig(repository));
+		return new PullImageCmdImpl(getDockerCmdExecFactory().createPullImageCmdExec(), repository);
 	}
 
 	@Override
 	public PushImageCmd pushImageCmd(String name) {
-		return new PushImageCmdImpl(getDockerCmdExecFactory()
-				.createPushImageCmdExec(), name).withAuthConfig(dockerClientConfig.effectiveAuthConfig(name));		
+		PushImageCmd cmd = new PushImageCmdImpl(getDockerCmdExecFactory().createPushImageCmdExec(),
+				name);
+		String dockerCfgFile = dockerClientConfig.getDockerCfgPath();
+		if (dockerCfgFile != null) {
+			AuthConfigFile authConfigFile;
+			try {
+				authConfigFile = AuthConfigFile.loadConfig(new File(dockerCfgFile));
+			} catch (IOException e) {
+				throw new DockerClientException("Failed to parse dockerCfgFile", e);
+			}
+			ReposTag reposTag = NameParser.parseRepositoryTag(name);
+			HostnameReposName hostnameReposName = NameParser.resolveRepositoryName(reposTag.repos);
+			AuthConfig authConfig = authConfigFile.resolveAuthConfig(hostnameReposName.hostname);
+			if (authConfig != null) {
+				cmd.withAuthConfig(authConfig);
+			}
+		}
+		return cmd;
 	}
 
 	@Override
-	public CreateImageCmd createImageCmd(String repository,
-			InputStream imageStream) {
-		return new CreateImageCmdImpl(getDockerCmdExecFactory()
-				.createCreateImageCmdExec(), repository, imageStream);
+	public CreateImageCmd createImageCmd(String repository, InputStream imageStream) {
+		return new CreateImageCmdImpl(getDockerCmdExecFactory().createCreateImageCmdExec(), repository, imageStream);
 	}
 
 	@Override
 	public SearchImagesCmd searchImagesCmd(String term) {
-		return new SearchImagesCmdImpl(getDockerCmdExecFactory()
-				.createSearchImagesCmdExec(), term);
+		return new SearchImagesCmdImpl(getDockerCmdExecFactory().createSearchImagesCmdExec(), term);
 	}
 
 	@Override
 	public RemoveImageCmd removeImageCmd(String imageId) {
-		return new RemoveImageCmdImpl(getDockerCmdExecFactory()
-				.createRemoveImageCmdExec(), imageId);
+		return new RemoveImageCmdImpl(getDockerCmdExecFactory().createRemoveImageCmdExec(), imageId);
 	}
 
 	@Override
 	public ListImagesCmd listImagesCmd() {
-		return new ListImagesCmdImpl(getDockerCmdExecFactory()
-				.createListImagesCmdExec());
+		return new ListImagesCmdImpl(getDockerCmdExecFactory().createListImagesCmdExec());
 	}
 
 	@Override
 	public InspectImageCmd inspectImageCmd(String imageId) {
-		return new InspectImageCmdImpl(getDockerCmdExecFactory()
-				.createInspectImageCmdExec(), imageId);
+		return new InspectImageCmdImpl(getDockerCmdExecFactory().createInspectImageCmdExec(), imageId);
 	}
 
 	/**
@@ -171,134 +175,122 @@ public class DockerClientImpl implements Closeable, DockerClient {
 
 	@Override
 	public ListContainersCmd listContainersCmd() {
-		return new ListContainersCmdImpl(getDockerCmdExecFactory()
-				.createListContainersCmdExec());
+		return new ListContainersCmdImpl(getDockerCmdExecFactory().createListContainersCmdExec());
 	}
 
 	@Override
 	public CreateContainerCmd createContainerCmd(String image) {
-		return new CreateContainerCmdImpl(getDockerCmdExecFactory()
-				.createCreateContainerCmdExec(), image);
+		return new CreateContainerCmdImpl(getDockerCmdExecFactory().createCreateContainerCmdExec(), image);
 	}
 
 	@Override
 	public StartContainerCmd startContainerCmd(String containerId) {
-		return new StartContainerCmdImpl(getDockerCmdExecFactory()
-				.createStartContainerCmdExec(), containerId);
+		return new StartContainerCmdImpl(getDockerCmdExecFactory().createStartContainerCmdExec(), containerId);
 	}
 
 	@Override
 	public InspectContainerCmd inspectContainerCmd(String containerId) {
-		return new InspectContainerCmdImpl(getDockerCmdExecFactory()
-				.createInspectContainerCmdExec(), containerId);
+		return new InspectContainerCmdImpl(getDockerCmdExecFactory().createInspectContainerCmdExec(), containerId);
 	}
 
+    @Override
+    public ExecCreateCmd execCreateCmd(String containerId) {
+        return new ExecCreateCmdImpl(getDockerCmdExecFactory().createExecCmdExec(), containerId);
+    }
+
 	@Override
 	public RemoveContainerCmd removeContainerCmd(String containerId) {
-		return new RemoveContainerCmdImpl(getDockerCmdExecFactory()
-				.createRemoveContainerCmdExec(), containerId);
+		return new RemoveContainerCmdImpl(getDockerCmdExecFactory().createRemoveContainerCmdExec(), containerId);
 	}
 
 	@Override
 	public WaitContainerCmd waitContainerCmd(String containerId) {
-		return new WaitContainerCmdImpl(getDockerCmdExecFactory()
-				.createWaitContainerCmdExec(), containerId);
+		return new WaitContainerCmdImpl(getDockerCmdExecFactory().createWaitContainerCmdExec(), containerId);
 	}
 
 	@Override
 	public AttachContainerCmd attachContainerCmd(String containerId) {
-		return new AttachContainerCmdImpl(getDockerCmdExecFactory()
-				.createAttachContainerCmdExec(), containerId);
+		return new AttachContainerCmdImpl(getDockerCmdExecFactory().createAttachContainerCmdExec(), containerId);
 	}
 
+    @Override
+    public ExecStartCmd execStartCmd(String containerId) {
+        return new ExecStartCmdImpl(getDockerCmdExecFactory().createExecStartCmdExec(), containerId);
+    }
+
 	@Override
 	public LogContainerCmd logContainerCmd(String containerId) {
-		return new LogContainerCmdImpl(getDockerCmdExecFactory()
-				.createLogContainerCmdExec(), containerId);
+		return new LogContainerCmdImpl(getDockerCmdExecFactory().createLogContainerCmdExec(), containerId);
 	}
 
 	@Override
-	public CopyFileFromContainerCmd copyFileFromContainerCmd(
-			String containerId, String resource) {
-		return new CopyFileFromContainerCmdImpl(getDockerCmdExecFactory()
-				.createCopyFileFromContainerCmdExec(), containerId, resource);
+	public CopyFileFromContainerCmd copyFileFromContainerCmd(String containerId, String resource) {
+		return new CopyFileFromContainerCmdImpl(getDockerCmdExecFactory().createCopyFileFromContainerCmdExec(),  containerId, resource);
 	}
 
 	@Override
 	public ContainerDiffCmd containerDiffCmd(String containerId) {
-		return new ContainerDiffCmdImpl(getDockerCmdExecFactory()
-				.createContainerDiffCmdExec(), containerId);
+		return new ContainerDiffCmdImpl(getDockerCmdExecFactory().createContainerDiffCmdExec(), containerId);
 	}
 
 	@Override
 	public StopContainerCmd stopContainerCmd(String containerId) {
-		return new StopContainerCmdImpl(getDockerCmdExecFactory()
-				.createStopContainerCmdExec(), containerId);
+		return new StopContainerCmdImpl(getDockerCmdExecFactory().createStopContainerCmdExec(), containerId);
 	}
 
 	@Override
 	public KillContainerCmd killContainerCmd(String containerId) {
-		return new KillContainerCmdImpl(getDockerCmdExecFactory()
-				.createKillContainerCmdExec(), containerId);
+		return new KillContainerCmdImpl(getDockerCmdExecFactory().createKillContainerCmdExec(), containerId);
 	}
 
 	@Override
 	public RestartContainerCmd restartContainerCmd(String containerId) {
-		return new RestartContainerCmdImpl(getDockerCmdExecFactory()
-				.createRestartContainerCmdExec(), containerId);
+		return new RestartContainerCmdImpl(getDockerCmdExecFactory().createRestartContainerCmdExec(), containerId);
 	}
 
 	@Override
 	public CommitCmd commitCmd(String containerId) {
-		return new CommitCmdImpl(getDockerCmdExecFactory()
-				.createCommitCmdExec(), containerId);
+		return new CommitCmdImpl(getDockerCmdExecFactory().createCommitCmdExec(), containerId);
 	}
 
 	@Override
 	public BuildImageCmd buildImageCmd(File dockerFolder) {
-		return new BuildImageCmdImpl(getDockerCmdExecFactory()
-				.createBuildImageCmdExec(), dockerFolder);
+		return new BuildImageCmdImpl(getDockerCmdExecFactory().createBuildImageCmdExec(), dockerFolder);
 	}
 
 	@Override
 	public BuildImageCmd buildImageCmd(InputStream tarInputStream) {
-		return new BuildImageCmdImpl(getDockerCmdExecFactory()
-				.createBuildImageCmdExec(), tarInputStream);
+		return new BuildImageCmdImpl(getDockerCmdExecFactory().createBuildImageCmdExec(), tarInputStream);
 	}
 
 	@Override
 	public TopContainerCmd topContainerCmd(String containerId) {
-		return new TopContainerCmdImpl(getDockerCmdExecFactory()
-				.createTopContainerCmdExec(), containerId);
+		return new TopContainerCmdImpl(getDockerCmdExecFactory().createTopContainerCmdExec(), containerId);
 	}
 
 	@Override
 	public TagImageCmd tagImageCmd(String imageId, String repository, String tag) {
-		return new TagImageCmdImpl(getDockerCmdExecFactory()
-				.createTagImageCmdExec(), imageId, repository, tag);
+		return new TagImageCmdImpl(getDockerCmdExecFactory().createTagImageCmdExec(), imageId, repository, tag);
 	}
 
 	@Override
 	public PauseContainerCmd pauseContainerCmd(String containerId) {
-		return new PauseContainerCmdImpl(getDockerCmdExecFactory()
-				.createPauseContainerCmdExec(), containerId);
+		return new PauseContainerCmdImpl(getDockerCmdExecFactory().createPauseContainerCmdExec(), containerId);
 	}
 
 	@Override
 	public UnpauseContainerCmd unpauseContainerCmd(String containerId) {
-		return new UnpauseContainerCmdImpl(getDockerCmdExecFactory()
-				.createUnpauseContainerCmdExec(), containerId);
+		return new UnpauseContainerCmdImpl(getDockerCmdExecFactory().createUnpauseContainerCmdExec(), containerId);
 	}
 
-	@Override
-	public EventsCmd eventsCmd(EventCallback eventCallback) {
-		return new EventsCmdImpl(getDockerCmdExecFactory()
-				.createEventsCmdExec(), eventCallback);
-	}
+    @Override
+    public EventsCmd eventsCmd(EventCallback eventCallback) {
+        return new EventsCmdImpl(getDockerCmdExecFactory().createEventsCmdExec(), eventCallback);
+    }
 
-	@Override
-	public void close() throws IOException {
-		getDockerCmdExecFactory().close();
-	}
+    @Override
+    public void close() throws IOException {
+        getDockerCmdExecFactory().close();
+    }
 
 }
diff --git a/src/main/java/com/github/dockerjava/core/command/CreateContainerCmdImpl.java b/src/main/java/com/github/dockerjava/core/command/CreateContainerCmdImpl.java
index b8cde7fe..8a4607c2 100644
--- a/src/main/java/com/github/dockerjava/core/command/CreateContainerCmdImpl.java
+++ b/src/main/java/com/github/dockerjava/core/command/CreateContainerCmdImpl.java
@@ -39,7 +39,6 @@ public class CreateContainerCmdImpl extends AbstrDockerCmd<CreateContainerCmd, C
     @JsonProperty("StdinOnce")    private boolean   stdInOnce = false;
     @JsonProperty("Env")          private String[]  env;
     @JsonProperty("Cmd")          private String[]  cmd;
-    @JsonProperty("Entrypoint")   private String[]  entrypoint;
     @JsonProperty("Image")        private String    image;
     @JsonProperty("Volumes")      private Volumes volumes = new Volumes();
     @JsonProperty("WorkingDir")   private String workingDir = "";
@@ -254,17 +253,6 @@ public class CreateContainerCmdImpl extends AbstrDockerCmd<CreateContainerCmd, C
         this.cmd = cmd;
         return this;
     }
-    
-    @Override
-    public String[] getEntrypoint() {
-    	return entrypoint;
-    }
-    
-    @Override
-	public CreateContainerCmdImpl withEntrypoint(String... entrypoint) {
-        this.entrypoint = entrypoint;
-        return this;
-    }
 
     @Override
     public String[] getDns() {
diff --git a/src/main/java/com/github/dockerjava/core/command/ExecCreateCmdImpl.java b/src/main/java/com/github/dockerjava/core/command/ExecCreateCmdImpl.java
new file mode 100644
index 00000000..22ff6394
--- /dev/null
+++ b/src/main/java/com/github/dockerjava/core/command/ExecCreateCmdImpl.java
@@ -0,0 +1,69 @@
+package com.github.dockerjava.core.command;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.github.dockerjava.api.NotFoundException;
+import com.github.dockerjava.api.command.ExecCreateCmd;
+import com.github.dockerjava.api.command.ExecCreateCmdResponse;
+
+public class ExecCreateCmdImpl extends AbstrDockerCmd<ExecCreateCmd, ExecCreateCmdResponse> implements ExecCreateCmd {
+
+    private String containerId;
+
+    @JsonProperty("AttachStdin")
+    private boolean attachStdin;
+
+    @JsonProperty("AttachStdout")
+    private boolean attachStdout;
+
+    @JsonProperty("AttachStderr")
+    private boolean attachStderr;
+
+    @JsonProperty("Tty")
+    private boolean tty;
+
+    @JsonProperty("Cmd")
+    private String[] cmd;
+
+    public ExecCreateCmdImpl(ExecCreateCmd.Exec exec, String containerId) {
+        super(exec);
+        this.containerId = containerId;
+    }
+
+    public ExecCreateCmd attachStdin(boolean attachStdin) {
+        this.attachStdin = attachStdin;
+        return this;
+    }
+
+    public ExecCreateCmd attachStdout(boolean attachStdout) {
+        this.attachStdout = attachStdout;
+        return this;
+    }
+
+    public ExecCreateCmd tty(boolean tty) {
+        this.tty = tty;
+        return this;
+    }
+
+    public ExecCreateCmd attachStderr(boolean attachStderr) {
+        this.attachStderr = attachStderr;
+        return this;
+    }
+
+    public ExecCreateCmd withCmd(String... cmd) {
+        this.cmd = cmd;
+        return this;
+    }
+
+    @Override
+    public String getContainerId() {
+        return containerId;
+    }
+
+    /**
+     * @throws NotFoundException No such container
+     */
+    @Override
+    public ExecCreateCmdResponse exec() throws NotFoundException {
+        return super.exec();
+    }
+}
diff --git a/src/main/java/com/github/dockerjava/core/command/ExecStartCmdImpl.java b/src/main/java/com/github/dockerjava/core/command/ExecStartCmdImpl.java
new file mode 100644
index 00000000..b3c37dc5
--- /dev/null
+++ b/src/main/java/com/github/dockerjava/core/command/ExecStartCmdImpl.java
@@ -0,0 +1,43 @@
+package com.github.dockerjava.core.command;
+
+import com.github.dockerjava.api.NotFoundException;
+import com.github.dockerjava.api.command.ExecStartCmd;
+import com.google.common.base.Preconditions;
+
+import java.io.InputStream;
+
+public class ExecStartCmdImpl extends AbstrDockerCmd<ExecStartCmd, InputStream> implements ExecStartCmd {
+
+    private String containerId;
+
+    private boolean detach, tty;
+
+    public ExecStartCmdImpl(ExecStartCmd.Exec exec, String containerId) {
+        super(exec);
+        Preconditions.checkNotNull(containerId, "containerId was not specified");
+        this.containerId = containerId;
+    }
+
+    @Override
+    public String getContainerId() {
+        return containerId;
+    }
+
+    @Override
+    public boolean isDetach() {
+        return detach;
+    }
+
+    @Override
+    public boolean isTty() {
+        return tty;
+    }
+
+    /**
+     * @throws com.github.dockerjava.api.NotFoundException No such container
+     */
+    @Override
+    public InputStream exec() throws NotFoundException {
+        return super.exec();
+    }
+}
diff --git a/src/main/java/com/github/dockerjava/core/command/PullImageCmdImpl.java b/src/main/java/com/github/dockerjava/core/command/PullImageCmdImpl.java
index b2e62434..ed045878 100644
--- a/src/main/java/com/github/dockerjava/core/command/PullImageCmdImpl.java
+++ b/src/main/java/com/github/dockerjava/core/command/PullImageCmdImpl.java
@@ -1,6 +1,7 @@
 package com.github.dockerjava.core.command;
 
 import com.github.dockerjava.api.command.PullImageCmd;
+import com.github.dockerjava.api.model.AuthConfig;
 import com.google.common.base.Preconditions;
 
 import java.io.InputStream;
@@ -10,9 +11,10 @@ import java.io.InputStream;
  * Pull image from repository.
  *
  */
-public class PullImageCmdImpl extends AbstrAuthCfgDockerCmd<PullImageCmd, InputStream> implements PullImageCmd {
+public class PullImageCmdImpl extends AbstrDockerCmd<PullImageCmd, InputStream> implements PullImageCmd {
 
     private String repository, tag, registry;
+    private AuthConfig authConfig;
 
 	public PullImageCmdImpl(PullImageCmd.Exec exec, String repository) {
 		super(exec);
@@ -34,6 +36,10 @@ public class PullImageCmdImpl extends AbstrAuthCfgDockerCmd<PullImageCmd, InputS
         return registry;
     }
 
+    public AuthConfig getAuthConfig() {
+        return authConfig;
+    }
+
     @Override
 	public PullImageCmd withRepository(String repository) {
 		Preconditions.checkNotNull(repository, "repository was not specified");
@@ -55,6 +61,13 @@ public class PullImageCmdImpl extends AbstrAuthCfgDockerCmd<PullImageCmd, InputS
 		return this;
 	}
 
+    @Override
+    public PullImageCmd withAuthConfig(AuthConfig authConfig) {
+		Preconditions.checkNotNull(authConfig, "authConfig was not specified");
+        this.authConfig = authConfig;
+        return this;
+    }
+
     @Override
     public String toString() {
         return new StringBuilder("pull ")
diff --git a/src/main/java/com/github/dockerjava/jaxrs/DockerCmdExecFactoryImpl.java b/src/main/java/com/github/dockerjava/jaxrs/DockerCmdExecFactoryImpl.java
index 64222a97..525e4a58 100644
--- a/src/main/java/com/github/dockerjava/jaxrs/DockerCmdExecFactoryImpl.java
+++ b/src/main/java/com/github/dockerjava/jaxrs/DockerCmdExecFactoryImpl.java
@@ -3,15 +3,12 @@ package com.github.dockerjava.jaxrs;
 import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
 import com.github.dockerjava.api.DockerClientException;
 import com.github.dockerjava.api.command.*;
-import com.github.dockerjava.core.CertificateUtils;
 import com.github.dockerjava.core.DockerClientConfig;
 import com.github.dockerjava.jaxrs.util.JsonClientFilter;
 import com.github.dockerjava.jaxrs.util.ResponseStatusExceptionFilter;
 import com.github.dockerjava.jaxrs.util.SelectiveLoggingFilter;
 import com.google.common.base.Preconditions;
-import org.bouncycastle.jce.provider.BouncyCastleProvider;
 import org.glassfish.jersey.CommonProperties;
-import org.glassfish.jersey.SslConfigurator;
 import org.glassfish.jersey.client.ClientConfig;
 import org.glassfish.jersey.client.ClientProperties;
 
@@ -20,8 +17,6 @@ import javax.ws.rs.client.Client;
 import javax.ws.rs.client.ClientBuilder;
 import javax.ws.rs.client.WebTarget;
 import java.io.IOException;
-import java.security.KeyStore;
-import java.security.Security;
 import java.util.logging.Logger;
 
 public class DockerCmdExecFactoryImpl implements DockerCmdExecFactory {
@@ -154,6 +149,11 @@ public class DockerCmdExecFactoryImpl implements DockerCmdExecFactory {
         return new InspectContainerCmdExec(getBaseResource());
     }
 
+    @Override
+    public ExecCreateCmd.Exec createExecCmdExec() {
+        return new ExecCreateCmdExec(getBaseResource());
+    }
+
     @Override
     public RemoveContainerCmd.Exec createRemoveContainerCmdExec() {
         return new RemoveContainerCmdExec(getBaseResource());
@@ -169,6 +169,11 @@ public class DockerCmdExecFactoryImpl implements DockerCmdExecFactory {
         return new AttachContainerCmdExec(getBaseResource());
     }
 
+    @Override
+    public ExecStartCmd.Exec createExecStartCmdExec() {
+        return new ExecStartCmdExec(getBaseResource());
+    }
+
     @Override
     public LogContainerCmd.Exec createLogContainerCmdExec() {
         return new LogContainerCmdExec(getBaseResource());
diff --git a/src/main/java/com/github/dockerjava/jaxrs/ExecCreateCmdExec.java b/src/main/java/com/github/dockerjava/jaxrs/ExecCreateCmdExec.java
new file mode 100644
index 00000000..69346efd
--- /dev/null
+++ b/src/main/java/com/github/dockerjava/jaxrs/ExecCreateCmdExec.java
@@ -0,0 +1,30 @@
+package com.github.dockerjava.jaxrs;
+
+import com.github.dockerjava.api.command.ExecCreateCmd;
+import com.github.dockerjava.api.command.ExecCreateCmdResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.ws.rs.client.WebTarget;
+import javax.ws.rs.core.MediaType;
+
+import static javax.ws.rs.client.Entity.entity;
+
+public class ExecCreateCmdExec extends AbstrDockerCmdExec<ExecCreateCmd, ExecCreateCmdResponse> implements ExecCreateCmd.Exec {
+
+    private static final Logger LOGGER = LoggerFactory
+            .getLogger(VersionCmdExec.class);
+
+    public ExecCreateCmdExec(WebTarget baseResource) {
+        super(baseResource);
+    }
+
+    @Override
+    protected ExecCreateCmdResponse execute(ExecCreateCmd command) {
+        WebTarget webResource = getBaseResource().path("/containers/{id}/exec").resolveTemplate("id", command.getContainerId());
+
+        LOGGER.trace("POST: {}", webResource);
+
+        return webResource.request().accept(MediaType.APPLICATION_JSON).post(entity(command, MediaType.APPLICATION_JSON), ExecCreateCmdResponse.class);
+    }
+}
diff --git a/src/main/java/com/github/dockerjava/jaxrs/ExecStartCmdExec.java b/src/main/java/com/github/dockerjava/jaxrs/ExecStartCmdExec.java
new file mode 100644
index 00000000..d5f7c478
--- /dev/null
+++ b/src/main/java/com/github/dockerjava/jaxrs/ExecStartCmdExec.java
@@ -0,0 +1,31 @@
+package com.github.dockerjava.jaxrs;
+
+import com.github.dockerjava.api.command.ExecStartCmd;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.ws.rs.client.WebTarget;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import java.io.InputStream;
+
+import static javax.ws.rs.client.Entity.entity;
+
+public class ExecStartCmdExec extends AbstrDockerCmdExec<ExecStartCmd, InputStream> implements ExecStartCmd.Exec {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(ExecStartCmdExec.class);
+
+    public ExecStartCmdExec(WebTarget baseResource) {
+        super(baseResource);
+    }
+
+
+    @Override
+    protected InputStream execute(ExecStartCmd command) {
+        WebTarget webResource = getBaseResource().path("/exec/{id}/start").resolveTemplate("id", command.getContainerId());
+
+        LOGGER.trace("POST: {}", webResource);
+
+        return webResource.request().accept(MediaType.APPLICATION_JSON).post(entity(command, MediaType.APPLICATION_JSON), Response.class).readEntity(InputStream.class);
+    }
+}
diff --git a/src/main/java/com/github/dockerjava/jaxrs/StartContainerCmdExec.java b/src/main/java/com/github/dockerjava/jaxrs/StartContainerCmdExec.java
index 8a2c09a4..0e7697e4 100644
--- a/src/main/java/com/github/dockerjava/jaxrs/StartContainerCmdExec.java
+++ b/src/main/java/com/github/dockerjava/jaxrs/StartContainerCmdExec.java
@@ -20,8 +20,7 @@ public class StartContainerCmdExec extends AbstrDockerCmdExec<StartContainerCmd,
 
 	@Override
 	protected Void execute(StartContainerCmd command) {
-		WebTarget webResource = getBaseResource().path("/containers/{id}/start")
-				.resolveTemplate("id", command.getContainerId());
+		WebTarget webResource = getBaseResource().path("/containers/{id}/start").resolveTemplate("id", command.getContainerId());
 
 		LOGGER.trace("POST: {}", webResource);
 		webResource.request().accept(MediaType.APPLICATION_JSON).post(entity(command, MediaType.APPLICATION_JSON));


Test patch:
diff --git a/src/test/java/com/github/dockerjava/core/TestDockerCmdExecFactory.java b/src/test/java/com/github/dockerjava/core/TestDockerCmdExecFactory.java
index 3a5857c9..c63667a0 100644
--- a/src/test/java/com/github/dockerjava/core/TestDockerCmdExecFactory.java
+++ b/src/test/java/com/github/dockerjava/core/TestDockerCmdExecFactory.java
@@ -6,41 +6,8 @@ import java.security.SecureRandom;
 import java.util.ArrayList;
 import java.util.List;
 
-import com.github.dockerjava.api.command.AttachContainerCmd;
+import com.github.dockerjava.api.command.*;
 import com.github.dockerjava.api.command.AuthCmd.Exec;
-import com.github.dockerjava.api.command.BuildImageCmd;
-import com.github.dockerjava.api.command.CommitCmd;
-import com.github.dockerjava.api.command.ContainerDiffCmd;
-import com.github.dockerjava.api.command.CopyFileFromContainerCmd;
-import com.github.dockerjava.api.command.CreateContainerCmd;
-import com.github.dockerjava.api.command.CreateContainerResponse;
-import com.github.dockerjava.api.command.CreateImageCmd;
-import com.github.dockerjava.api.command.CreateImageResponse;
-import com.github.dockerjava.api.command.DockerCmdExecFactory;
-import com.github.dockerjava.api.command.EventsCmd;
-import com.github.dockerjava.api.command.InfoCmd;
-import com.github.dockerjava.api.command.InspectContainerCmd;
-import com.github.dockerjava.api.command.InspectImageCmd;
-import com.github.dockerjava.api.command.KillContainerCmd;
-import com.github.dockerjava.api.command.ListContainersCmd;
-import com.github.dockerjava.api.command.ListImagesCmd;
-import com.github.dockerjava.api.command.LogContainerCmd;
-import com.github.dockerjava.api.command.PauseContainerCmd;
-import com.github.dockerjava.api.command.PingCmd;
-import com.github.dockerjava.api.command.PullImageCmd;
-import com.github.dockerjava.api.command.PushImageCmd;
-import com.github.dockerjava.api.command.RemoveContainerCmd;
-import com.github.dockerjava.api.command.RemoveImageCmd;
-import com.github.dockerjava.api.command.RestartContainerCmd;
-import com.github.dockerjava.api.command.SearchImagesCmd;
-import com.github.dockerjava.api.command.StartContainerCmd;
-import com.github.dockerjava.api.command.StopContainerCmd;
-import com.github.dockerjava.api.command.TagImageCmd;
-import com.github.dockerjava.api.command.TopContainerCmd;
-import com.github.dockerjava.api.command.UnpauseContainerCmd;
-import com.github.dockerjava.api.command.VersionCmd;
-import com.github.dockerjava.api.command.WaitContainerCmd;
-import com.github.dockerjava.core.DockerClientConfig;
 
 /**
  * Special {@link DockerCmdExecFactory} implementation that collects container and image creations
@@ -154,7 +121,12 @@ public class TestDockerCmdExecFactory implements DockerCmdExecFactory {
 		return delegate.createPingCmdExec();
 	}
 
-	@Override
+    @Override
+    public ExecCreateCmd.Exec createExecCmdExec() {
+        return delegate.createExecCmdExec();
+    }
+
+    @Override
 	public VersionCmd.Exec createVersionCmdExec() {
 		return delegate.createVersionCmdExec();
 	}
@@ -209,7 +181,12 @@ public class TestDockerCmdExecFactory implements DockerCmdExecFactory {
 		return delegate.createAttachContainerCmdExec();
 	}
 
-	@Override
+    @Override
+    public ExecStartCmd.Exec createExecStartCmdExec() {
+        return delegate.createExecStartCmdExec();
+    }
+
+    @Override
 	public LogContainerCmd.Exec createLogContainerCmdExec() {
 		return delegate.createLogContainerCmdExec();
 	}
diff --git a/src/test/java/com/github/dockerjava/core/command/CreateContainerCmdImplTest.java b/src/test/java/com/github/dockerjava/core/command/CreateContainerCmdImplTest.java
index 2b879a9a..ac3db5ea 100644
--- a/src/test/java/com/github/dockerjava/core/command/CreateContainerCmdImplTest.java
+++ b/src/test/java/com/github/dockerjava/core/command/CreateContainerCmdImplTest.java
@@ -291,23 +291,5 @@ public class CreateContainerCmdImplTest extends AbstractDockerClientTest {
 		assertThat(Arrays.asList(inspectContainerResponse.getHostConfig().getDns()),
 				contains(aDnsServer, anotherDnsServer));
 	}
-	
-	@Test
-	public void createContainerWithEntrypoint() throws DockerException {
-
-		CreateContainerResponse container = dockerClient
-				.createContainerCmd("busybox").withName("container")
-				.withEntrypoint("sleep", "9999").exec();
-
-		LOG.info("Created container {}", container.toString());
-
-		assertThat(container.getId(), not(isEmptyString()));
-
-		InspectContainerResponse inspectContainerResponse = dockerClient
-				.inspectContainerCmd(container.getId()).exec();
-
-		assertThat(Arrays.asList(inspectContainerResponse.getConfig().getEntrypoint()), contains("sleep", "9999"));
-
-	}
 
 }
diff --git a/src/test/java/com/github/dockerjava/core/command/ExecCreateCmdImplTest.java b/src/test/java/com/github/dockerjava/core/command/ExecCreateCmdImplTest.java
new file mode 100644
index 00000000..338763e6
--- /dev/null
+++ b/src/test/java/com/github/dockerjava/core/command/ExecCreateCmdImplTest.java
@@ -0,0 +1,57 @@
+package com.github.dockerjava.core.command;
+
+import com.github.dockerjava.api.DockerException;
+import com.github.dockerjava.api.command.CreateContainerResponse;
+import com.github.dockerjava.api.command.ExecCreateCmdResponse;
+import com.github.dockerjava.client.AbstractDockerClientTest;
+import org.testng.ITestResult;
+import org.testng.annotations.*;
+
+import java.lang.reflect.Method;
+import java.security.SecureRandom;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.isEmptyString;
+import static org.hamcrest.Matchers.not;
+
+@Test(groups = "integration")
+public class ExecCreateCmdImplTest extends AbstractDockerClientTest {
+    @BeforeTest
+    public void beforeTest() throws DockerException {
+        super.beforeTest();
+    }
+
+    @AfterTest
+    public void afterTest() {
+        super.afterTest();
+    }
+
+    @BeforeMethod
+    public void beforeMethod(Method method) {
+        super.beforeMethod(method);
+    }
+
+    @AfterMethod
+    public void afterMethod(ITestResult result) {
+        super.afterMethod(result);
+    }
+
+    @Test
+    public void execCreateTest() {
+        String containerName = "generated_" + new SecureRandom().nextInt();
+
+        CreateContainerResponse container = dockerClient
+                .createContainerCmd("busybox").withCmd("top")
+                .withName(containerName).exec();
+
+        LOG.info("Created container {}", container.toString());
+
+        assertThat(container.getId(), not(isEmptyString()));
+
+        dockerClient.startContainerCmd(container.getId()).exec();
+
+        ExecCreateCmdResponse execCreateCmdResponse = dockerClient.execCreateCmd(container.getId()).withCmd("touch","file.log").exec();
+
+        assertThat(execCreateCmdResponse.getId(), not(isEmptyString()));
+    }
+}
diff --git a/src/test/java/com/github/dockerjava/core/command/ExecStartCmdImplTest.java b/src/test/java/com/github/dockerjava/core/command/ExecStartCmdImplTest.java
new file mode 100644
index 00000000..044d1345
--- /dev/null
+++ b/src/test/java/com/github/dockerjava/core/command/ExecStartCmdImplTest.java
@@ -0,0 +1,60 @@
+package com.github.dockerjava.core.command;
+
+import com.github.dockerjava.api.DockerException;
+import com.github.dockerjava.api.command.CreateContainerResponse;
+import com.github.dockerjava.api.command.ExecCreateCmdResponse;
+import com.github.dockerjava.client.AbstractDockerClientTest;
+import org.testng.ITestResult;
+import org.testng.annotations.*;
+
+import java.io.InputStream;
+import java.lang.reflect.Method;
+import java.security.SecureRandom;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.isEmptyString;
+import static org.hamcrest.Matchers.not;
+
+@Test(groups = "integration")
+public class ExecStartCmdImplTest extends AbstractDockerClientTest {
+    @BeforeTest
+    public void beforeTest() throws DockerException {
+        super.beforeTest();
+    }
+
+    @AfterTest
+    public void afterTest() {
+        super.afterTest();
+    }
+
+    @BeforeMethod
+    public void beforeMethod(Method method) {
+        super.beforeMethod(method);
+    }
+
+    @AfterMethod
+    public void afterMethod(ITestResult result) {
+        super.afterMethod(result);
+    }
+
+    @Test
+    public void execStartTest() throws Exception {
+        String containerName = "generated_" + new SecureRandom().nextInt();
+
+        CreateContainerResponse container = dockerClient
+                .createContainerCmd("busybox").withCmd("top")
+                .withName(containerName).exec();
+
+        LOG.info("Created container {}", container.toString());
+
+        assertThat(container.getId(), not(isEmptyString()));
+
+        dockerClient.startContainerCmd(container.getId()).exec();
+
+        ExecCreateCmdResponse execCreateCmdResponse = dockerClient.execCreateCmd(container.getId()).attachStdout(true).withCmd("touch","file.log").exec();
+        dockerClient.execStartCmd(execCreateCmdResponse.getId()).exec();
+
+        InputStream response = dockerClient.copyFileFromContainerCmd(container.getId(), "/file.log").exec();
+        assertTrue(response.available() > 0, "The file was not copied from the container.");
+    }
+}
diff --git a/src/test/java/com/github/dockerjava/core/command/StartContainerCmdImplTest.java b/src/test/java/com/github/dockerjava/core/command/StartContainerCmdImplTest.java
index de744b59..10b656e6 100644
--- a/src/test/java/com/github/dockerjava/core/command/StartContainerCmdImplTest.java
+++ b/src/test/java/com/github/dockerjava/core/command/StartContainerCmdImplTest.java
@@ -200,7 +200,7 @@ public class StartContainerCmdImplTest extends AbstractDockerClientTest {
 		dockerClient.startContainerCmd(container.getId()).withPortBindings(portBindings).exec();
 
 		inspectContainerResponse = dockerClient.inspectContainerCmd(container
-				.getId()).exec();
+                .getId()).exec();
 
 		assertThat(Arrays.asList(inspectContainerResponse.getConfig().getExposedPorts()),
 				contains(tcp22, tcp23));