code: public String createAndStartContainer(ImageConfiguration imageConfig,
                                            PortMapping portMapping,
                                            GavLabel gavLabel,
                                            Properties properties,
                                            File baseDir,
                                            String defaultContainerNamePattern,
                                            Date buildTimestamp) throws DockerAccessException {
          RunImageConfiguration runConfig = imageConfig.getRunConfiguration();
          String imageName = imageConfig.getName();
  
          Collection<Container> existingContainers = queryService.getContainersForImage(imageName, true);
          String containerName = ContainerNamingUtil.formatContainerName(imageConfig, defaultContainerNamePattern, buildTimestamp, existingContainers);
  
          ContainerCreateConfig config = createContainerConfig(imageName, runConfig, portMapping, gavLabel, properties, baseDir);
  
          String id = docker.createContainer(config, containerName);
          startContainer(imageConfig, id, gavLabel);
  
          if (portMapping.needsPropertiesUpdate()) {
              updateMappedPortsAndAddresses(id, portMapping);
          }
  
          return id;
      }
docs: Create and start a container with the given image configuration.
  @param imageConfig image configuration holding the run information and the image name
  @param portMapping container port mapping
  @param gavLabel label to tag the started container with
  
  @param properties properties to fill in with dynamically assigned ports
  @param defaultContainerNamePattern pattern to use for naming containers. Can be null in which case a default pattern is used
  @param buildTimestamp date which should be used as the timestamp when calculating container names
  @return the container id
  
  @throws DockerAccessException if access to the docker backend fails