第一次提交测试 2025.07.20 skimrme
This commit is contained in:
25
public/docker-registry/all-images/index.php
Normal file
25
public/docker-registry/all-images/index.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
// 1. 定义你的 Docker Registry 地址
|
||||
// 请将 'http://localhost:5000' 替换为你的实际 Registry 地址。
|
||||
// 例如:如果你的 Registry 是 'my-registry.io',就改为 'https://my-registry.io'
|
||||
$registryUrl = "https://regw.ww3.tw/";
|
||||
|
||||
// 2. 定义你要获取的 API 端点
|
||||
// 这个端点用于获取所有仓库列表。
|
||||
$endpoint = "/v2/_catalog";
|
||||
|
||||
// 3. 组合完整的 URL
|
||||
$fullUrl = $registryUrl . $endpoint;
|
||||
|
||||
// 4. 使用 file_get_contents() 获取 JSON 内容
|
||||
// @ 符号用来抑制可能出现的错误或警告,让输出更干净。
|
||||
$jsonContent = @file_get_contents($fullUrl);
|
||||
|
||||
// 5. 直接输出 JSON 内容
|
||||
// 如果成功获取到内容,就直接打印出来。
|
||||
// 如果获取失败,会打印一个空字符串或PHP的错误信息(如果没用@抑制)。
|
||||
header('Content-Type: application/json'); // 告诉浏览器这是一个JSON响应
|
||||
echo $jsonContent;
|
||||
|
||||
?>
|
||||
11
public/docker-registry/index.html
Normal file
11
public/docker-registry/index.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>docker-registry</title>
|
||||
<meta charset="utf-8" lang="zh-CN">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<a href="./all-images/index.php">查看所有镜像</a>
|
||||
<p>tags/list</p>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user