* Fixed a bug where the lockfile would be released on exit even if
  it wasn't locked by the process
* Disabled the phpx build as it is broken
This commit is contained in:
2022-07-05 22:46:11 +02:00
parent 879bf88864
commit 88f3b75383
6 changed files with 34 additions and 13 deletions

View File

@ -23,7 +23,11 @@ class RegistryV2Client
public function getManifest(string $image, string $tag)
{
$response = $this->client->get("{$image}/manifests/{$tag}");
$response = $this->client->get("{$image}/manifests/{$tag}", [
'headers' => [
//'Accept' => 'application/vnd.docker.distribution.manifest.v2+json',
]
]);
$body = $response->getBody();
return json_decode($body);
}
@ -32,12 +36,16 @@ class RegistryV2Client
{
$manifest = $this->getManifest($image, $tag);
$fslayers = (array)$manifest->fsLayers;
$fshashes = array_map(fn($layer) => $layer->blobSum, $fslayers);
//print_r($manifest);
$fslayers = (array)(($manifest->fsLayers??$manifest->layers)??[]);
$fshashes = array_map(fn($layer) => $layer->blobSum??$layer->digest, $fslayers);
$metahash = hash("sha256", join("|", $fshashes));
$history = $manifest->history[0];
$info = json_decode($history->v1Compatibility);
if (isset($manifest->history)) {
$history = $manifest->history[0];
$info = json_decode($history->v1Compatibility);
}
return [
'image' => $image,