public void isDockerRunning() throws HyscaleException {
        String command = commandGenerator.dockerVersion();
        logger.debug("Docker Installed check command: {}", command);
        boolean success = CommandExecutor.execute(command);
        if (!success) {
            throw new HyscaleException(ImageBuilderErrorCodes.DOCKER_NOT_INSTALLED);
        }
        command = commandGenerator.dockerImages();
        logger.debug("Docker Daemon running check command: {}", command);
        success = CommandExecutor.execute(command);
        if (!success) {
            WorkflowLogger.error(ImageBuilderActivity.DOCKER_DAEMON_NOT_RUNNING);
            throw new HyscaleException(ImageBuilderErrorCodes.DOCKER_DAEMON_NOT_RUNNING);
        }
    }
Test if docker is installed and docker daemon is running
image-builder/builder-services/src/main/java/io/hyscale/builder/services/util/DockerImageUtil.java