public void stopPreviouslyStartedContainer(String containerId,
                                               boolean keepContainer,
                                               boolean removeVolumes)
        throws DockerAccessException, ExecException {
        ContainerTracker.ContainerShutdownDescriptor descriptor = tracker.removeContainer(containerId);
        if (descriptor != null) {
            shutdown(descriptor, keepContainer, removeVolumes);
        }
    }
Lookup up whether a certain has been already started and registered. If so, stop it

@param containerId the container to stop
@param keepContainer whether to keep container or to remove them after stoppings
@param removeVolumes whether to remove volumes after stopping

@throws DockerAccessException
src/main/java/io/fabric8/maven/docker/service/RunService.java