/** * Get history of an image * * @param Image $image * * @throws \Docker\Exception\UnexpectedStatusCodeException * * @return array */ public function history(Image $image) { $response = $this->client->get(['/images/{name}/history', ['name' => $image->__toString()]]); if ($response->getStatusCode() !== "200") { throw UnexpectedStatusCodeException::fromResponse($response); } return $response->json(); }
/** * Delete an image from docker daemon * * @param Image $image Image to delete * @param boolean $force Force deletion of image (default false) * @param boolean $noprune Do not delete parent images (default false) * * @throws \Docker\Exception\UnexpectedStatusCodeException * * @return ImageManager */ public function delete(Image $image, $force = false, $noprune = false) { $response = $this->client->delete(['/images/{image}?force={force}&noprune={noprune}', ['image' => $image->__toString(), 'force' => $force, 'noprune' => $noprune, 'wait' => true]]); if ($response->getStatusCode() !== "200") { throw UnexpectedStatusCodeException::fromResponse($response); } return $this; }