public function stop(Job $job, $timeout = 10)
    {
        foreach ($job->getServices() as $service) {
            if ($service->getContainer()) {
                try {
                    $this->docker->getContainerManager()->stop($service->getContainer(), [
                        't' => $timeout
                    ]);
                } catch (ClientErrorException $e) {
                    if ($e->getResponse()->getStatusCode() != 304) {
                        throw $e;
                    }
                }

                $this->docker->getContainerManager()->remove($service->getContainer(), [
                    'v' => true,
                    'force' => true
                ]);

                $service->setContainer(null);
            }
        }
    }