code: public String runContainer(DockerSlaveTemplate slaveTemplate) throws DockerException, IOException {
          final DockerCreateContainer dockerCreateContainer = slaveTemplate.getDockerContainerLifecycle().getCreateContainer();
          final String image = slaveTemplate.getDockerContainerLifecycle().getImage();
  
          CreateContainerCmd containerConfig = getClient().createContainerCmd(image);
  
          // template specific options
          dockerCreateContainer.fillContainerConfig(containerConfig, null);
  
          // launcher specific options
          slaveTemplate.getLauncher().appendContainerConfig(slaveTemplate, containerConfig);
  
          // cloud specific options
          appendContainerConfig(slaveTemplate, containerConfig);
  
          // create
          CreateContainerResponse response = containerConfig.exec();
          String containerId = response.getId();
          LOG.debug("Created container {}, for {}", containerId, getDisplayName());
  
          slaveTemplate.getLauncher().afterContainerCreate(getClient(), containerId);
  
          // start
          StartContainerCmd startCommand = getClient().startContainerCmd(containerId);
          try {
              startCommand.exec();
              LOG.debug("Running container {}, for {}", containerId, getDisplayName());
          } catch (Exception ex) {
              try {
                  getClient().logContainerCmd(containerId)
                          .withStdErr(true)
                          .withStdOut(true)
                          .exec(new MyLogContainerResultCallback())
                          .awaitCompletion();
              } catch (Throwable t) {
                  LOG.warn("Can't get logs for container start", t);
              }
  
              throw ex;
          }
  
          return containerId;
      }
docs: Run docker container for given template
  
  @return container id