src/Joli/JoliCi/Executor.php
public function create(Job $job)
    {
        $context  = new Context($this->buildPath . DIRECTORY_SEPARATOR . $job->getDirectory());

        $buildStream = $this->docker->getImageManager()->build($context->toStream(), [
            't' => $job->getName(),
            'q' => $this->quietBuild,
            'nocache' => !$this->usecache
        ], ImageManager::FETCH_STREAM);

        $buildStream->onFrame($this->logger->getBuildCallback());
        $buildStream->wait();

        try {
            return $this->docker->getImageManager()->find($job->getName());
        } catch (ClientErrorException $e) {
            if ($e->getResponse()->getStatusCode() == 404) {
                return false;
            }

            throw $e;
        }
    }
public function create(Job $job)
    {
        $context  = new Context($this->buildPath . DIRECTORY_SEPARATOR . $job->getDirectory());

        $buildStream = $this->docker->getImageManager()->build($context->toStream(), [
            't' => $job->getName(),
            'q' => $this->quietBuild,
            'nocache' => !$this->usecache
        ], ImageManager::FETCH_STREAM);

        $buildStream->onFrame($this->logger->getBuildCallback());
        $buildStream->wait();

        try {
            return $this->docker->getImageManager()->find($job->getName());
        } catch (ClientErrorException $e) {
            if ($e->getResponse()->getStatusCode() == 404) {
                return false;
            }

            throw $e;
        }
    }
public function create ( Job $ job ) { $ context = new Context ( $ this -> buildPath . DIRECTORY_SEPARATOR . $ job -> getDirectory ( ) ) ; $ buildStream = $ this -> docker -> getImageManager ( ) -> build ( $ context -> toStream ( ) , [ 't' => $ job -> getName ( ) , 'q' => $ this -> quietBuild , 'nocache' => ! $ this -> usecache ] , ImageManager :: FETCH_STREAM ) ; $ buildStream -> onFrame ( $ this -> logger -> getBuildCallback ( ) ) ; $ buildStream -> wait ( ) ; try { return $ this -> docker -> getImageManager ( ) -> find ( $ job -> getName ( ) ) ; } catch ( ClientErrorException $ e ) { if ( $ e -> getResponse ( ) -> getStatusCode ( ) == 404 ) { return false ; } throw $ e ; } }
Create a build

@param Job $job Build used to create image

@return \Docker\API\Model\Image|boolean Return the image created if successful or false otherwise
Create a build