public Container getMandatoryContainer(String containerIdOrName) throws DockerAccessException {
        Container container = getContainer(containerIdOrName);
        if (container == null) {
            throw new DockerAccessException("Cannot find container %s", containerIdOrName);
        }
        return container;
    }
Get container by id

@param containerIdOrName container id or name
@return container found
@throws DockerAccessException if an error occurs or no container with this id or name exists
src/main/java/io/fabric8/maven/docker/service/QueryService.java