public String createContainer(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);

        return docker.createContainer(config, containerName);
    }
Create 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
src/main/java/io/fabric8/maven/docker/service/RunService.java