@@ -13,6 +13,9 @@ const io = std.io;
13
13
const skopeo_content = @embedFile ("tools/skopeo" );
14
14
const mksquashfs_content = @embedFile ("tools/mksquashfs" );
15
15
const umoci_content = @embedFile ("tools/umoci.amd64" );
16
+
17
+ const policy_content = @embedFile ("tools/policy.json" );
18
+
16
19
const runtime_content = @embedFile ("runtime" );
17
20
18
21
const runtime_content_len_u64 = data : {
@@ -37,6 +40,9 @@ pub fn main() !void {
37
40
const mksquashfs_path = try extract_file (temp_dir_path , "mksquashfs" , mksquashfs_content , allocator );
38
41
defer allocator .free (mksquashfs_path );
39
42
43
+ const policy_path = try extract_file (temp_dir_path , "policy.json" , policy_content , allocator );
44
+ defer allocator .free (policy_path );
45
+
40
46
const params = comptime clap .parseParamsComptime (
41
47
\\-h, --help Display this help and exit.
42
48
\\-i, --image <str> Image to pull.
@@ -84,7 +90,7 @@ pub fn main() !void {
84
90
const destination_arg = try std .fmt .allocPrint (allocator , "oci:{s}/image:latest" , .{temp_dir_path });
85
91
defer allocator .free (destination_arg );
86
92
87
- var skopeoProcess = std .ChildProcess .init (&[_ ][]const u8 { skopeo_path , "copy" , image , destination_arg }, gpa .allocator ());
93
+ var skopeoProcess = std .ChildProcess .init (&[_ ][]const u8 { skopeo_path , "copy" , "--policy" , policy_path , image , destination_arg }, gpa .allocator ());
88
94
_ = try skopeoProcess .spawnAndWait ();
89
95
90
96
const umoci_image_layout_path = try std .fmt .allocPrint (allocator , "{s}/image:latest" , .{temp_dir_path });
0 commit comments