Docker自己構築倉庫自己開発管理
Dockerは自分で倉庫を建ててから鏡像を管理する問題に直面しています.ここで簡単な手順を書いて、レンガを投げて玉を引くとしています.pom.xmlの導入が必要なフレームバックは、jfinalにはパッケージされたhttp処理関数がありますので、簡単です.jfinalパッケージが必要です.jsonパッケージは解析帰りのjson結果
<dependency>
<groupId>com.jfinalgroupId>
<artifactId>jfinalartifactId>
<version>2.2version>
dependency>
・
<dependency>
<groupId>com.hynnetgroupId>
<artifactId>json-libartifactId>
<version>2.4version>
dependency>
import com.jfinal.kit.HttpKit;
・
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
・
public class Main {
// get url , URL
public static String httget(String url) {
・
String s = HttpKit.get(url);
・
return s;
}
public static void main(String[] args) {
// http://10.100.112.243:5000 , V2
String baseUrl = "http://10.100.112.243:5000/v2/";
・
String catalog = baseUrl + "_catalog";
・
//
JSONObject obj = JSONObject.fromObject(httget(catalog));
・
// json , json ,
JSONArray obj_minions = obj.getJSONArray("repositories");
・
//
for (int i = 0; i < obj_minions.size(); i++) {
・
System.out.println( httget(baseUrl + "/" + obj_minions.get(i) + "/tags/list"));
}
}
}
{"name":"apsops/filebeat-kubernetes","tags":["v0.2"]}
・
{"name":"bobrik/curator","tags":["latest"]}
・
{"name":"busybox","tags":["latest"]}
, CURD “C” 。
, , , 。
( 1)
method
path
Entity
Description
GET
/v2/
Base
Check that the endpoint implements Docker Registry API V2.
GET
/v2//tags/list
Tags
Fetch the tags under the repository identified by name.
GET
/v2//manifests/
Manifest
Fetch the manifest identified by nameand referencewhere referencecan be a tag or digest. A HEADrequest can also be issued to this endpoint to obtain resource information without receiving all data.
PUT
/v2//manifests/
Manifest
Put the manifest identified by nameand referencewhere referencecan be a tag or digest.
DELETE
/v2//manifests/
Manifest
Delete the manifest identified by nameand reference. Note that a manifest can only be deleted by digest.
GET
/v2//blobs/
Blob
Retrieve the blob from the registry identified bydigest. A HEADrequest can also be issued to this endpoint to obtain resource information without receiving all data.
DELETE
/v2//blobs/
Blob
Delete the blob identified by nameand digest
POST
/v2//blobs/uploads/
Initiate Blob Upload
Initiate a resumable blob upload. If successful, an upload location will be provided to complete the upload. Optionally, if thedigest parameter is present, the request body will be used to complete the upload in a single request.
GET
/v2//blobs/uploads/
Blob Upload
Retrieve status of upload identified byuuid. The primary purpose of this endpoint is to resolve the current status of a resumable upload.
PATCH
/v2//blobs/uploads/
Blob Upload
Upload a chunk of data for the specified upload.
PUT
/v2//blobs/uploads/
Blob Upload
Complete the upload specified by uuid, optionally appending the body as the final chunk.
DELETE
/v2//blobs/uploads/
Blob Upload
Cancel outstanding upload processes, releasing associated resources. If this is not called, the unfinished uploads will eventually timeout.
GET
/v2/_catalog
Catalog
Retrieve a sorted, json list of repositories available in the registry.
1 http://blog.csdn.net/ztsinghua/article/details/51496658
・