blob: 165d0bd38ee985c2bc789c9e904c84a1364b0560 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
package io.github.jshipit;
import com.fasterxml.jackson.databind.JsonNode;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
public class JshipIT {
public JshipIT() {
/*
DockerAPIHelper api = new DockerAPIHelper("registry.getcryst.al","crystal/misc", "docker", "latest");
JsonNode manifest = null;
System.out.println("API Token: " + api.getApiToken());
try {
manifest = api.fetchManifestJson();
} catch (IOException ignored) {} // Proper error handling is bloat
System.out.println("Manifest: " + manifest);
Path path = Path.of("./tmp_"+api.getImage()+"_"+api.getTag());
try {
Files.createDirectory(path);
} catch (IOException e) {
System.out.println("Failed to create directory: " + path);
e.printStackTrace();
return;
}
assert manifest != null;
JsonNode layers = manifest.get("layers");
for (JsonNode layer : layers) {
System.out.println("Layer: " + layer);
try {
api.fetchBlob(layer.get("digest").asText(), path.toString());
} catch (IOException e) {
e.printStackTrace();
}
}
*/
OCIDataStore dataStore = new OCIDataStore("./tmp");
dataStore.createImage("registry.getcryst.al","crystal/misc", "docker", "latest");
}
}
|