createClient($registry, $auth); } private function createClient(string $registry, ?array $auth) { $this->client = new Client([ 'base_uri' => 'https://' . $registry . '/v2/', 'auth' => $auth, ]); } public function getManifest(string $image, string $tag) { $response = $this->client->get("{$image}/manifests/{$tag}"); $body = $response->getBody(); return json_decode($body); } public function getImageStatus(string $image, string $tag) { $manifest = $this->getManifest($image, $tag); $fslayers = (array)$manifest->fsLayers; $fshashes = array_map(fn($layer) => $layer->blobSum, $fslayers); $metahash = hash("sha256", join("|", $fshashes)); $history = $manifest->history[0]; $info = json_decode($history->v1Compatibility); return [ 'image' => $image, 'tag' => $tag, 'hash' => $metahash, 'created' => $info->created??null, ]; } }