protected function execute(InputInterface $input, OutputInterface $output)
    {
        // retrieve the current settings
        $options = $this->getCurrentOptions($input, $output);

        // check if docker is installed
        if (false === $this->commandExists('docker')) {
            $output->writeln('Docker is required to run DUnit.');
            return self::ERROR_CODE;
        }
        // loop over each of the docker images specified
        foreach ($options[self::OPTIONS_KEY_IMAGES] as $image) {
            if ($options[self::OPTIONS_KEY_PULL]) {
                passthru(sprintf(
                    self::DOCKER_COMMAND_PULL,
                    escapeshellarg($image)
                ));
                continue;
            }

            $output->writeln('Running against image '.$image);
            if ($options[self::OPTIONS_KEY_SYNTAX]) {
                $output->writeln('Checking syntax');
                // run the syntax checks
                $this->executeCommandForImage(
                    $image,
                    $options[self::OPTIONS_KEY_SYNTAXCOMMAND]
                );
            }
            if ($options[self::OPTIONS_KEY_UNITTESTS]) {
                $output->writeln('Running unit test suite');
                // run the unit tests
                $this->executeCommandForImage(
                    $image,
                    $options[self::OPTIONS_KEY_UNITTESTSCOMMAND]
                );
            }
        }
        return self::NO_ERROR;
    }