]> git.ipfire.org Git - pakfire.git/commitdiff
OCI: Add an entrypoint to the image
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 8 Feb 2025 18:01:58 +0000 (18:01 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 8 Feb 2025 18:01:58 +0000 (18:01 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/oci.c

index 4059bc5347f81fd19134b052124142eca0c054fd..3914258d4c2a8afe6b73bc47c9e0a25a1b093a31 100644 (file)
@@ -198,6 +198,9 @@ static int pakfire_oci_writer_write_config(struct pakfire_oci_writer* self) {
        size_t size;
        int r;
 
+       struct json_object* config = NULL;
+       struct json_object* cmd = NULL;
+
        // Make a new object
        o = pakfire_json_new_object();
        if (!o) {
@@ -246,6 +249,21 @@ static int pakfire_oci_writer_write_config(struct pakfire_oci_writer* self) {
        if (r < 0)
                goto ERROR;
 
+       // Add config (yes I know)
+       r = pakfire_json_add_object(o, "config", &config);
+       if (r < 0)
+               goto ERROR;
+
+       // Add command
+       r = pakfire_json_add_array(config, "Cmd", &cmd);
+       if (r < 0)
+               goto ERROR;
+
+       // Add bash
+       r = pakfire_json_array_add_string(cmd, "bash");
+       if (r < 0)
+               goto ERROR;
+
        // Write as blob
        r = pakfire_oci_writer_write_json_blob(self, o, &hexdigest, &size);
        if (r < 0)