{"id":26442651,"url":"https://github.com/navidys/oci-spec-zig","last_synced_at":"2026-02-01T09:09:24.468Z","repository":{"id":282671292,"uuid":"949312467","full_name":"navidys/oci-spec-zig","owner":"navidys","description":"OCI Runtime, Image and Distribution Spec in Zig","archived":false,"fork":false,"pushed_at":"2026-01-30T22:20:25.000Z","size":78,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-30T22:27:26.465Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/navidys.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":"MAINTAINERS.md","copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-16T06:46:33.000Z","updated_at":"2026-01-30T22:20:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"d6434ab4-cc7f-473f-96c6-6e01c64c0469","html_url":"https://github.com/navidys/oci-spec-zig","commit_stats":null,"previous_names":["navidys/oci-spec-zig"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/navidys/oci-spec-zig","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navidys%2Foci-spec-zig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navidys%2Foci-spec-zig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navidys%2Foci-spec-zig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navidys%2Foci-spec-zig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/navidys","download_url":"https://codeload.github.com/navidys/oci-spec-zig/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navidys%2Foci-spec-zig/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28974380,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T08:16:14.655Z","status":"ssl_error","status_checked_at":"2026-02-01T08:06:51.373Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-18T10:29:37.060Z","updated_at":"2026-02-01T09:09:24.463Z","avatar_url":"https://github.com/navidys.png","language":"Zig","funding_links":[],"categories":["Systems Programming"],"sub_categories":["Kernel and Containers"],"readme":"![License](https://img.shields.io/badge/license-MIT-blue)\n![Build](https://github.com/navidys/oci-spec-zig/workflows/build/badge.svg)\n[![codecov](https://codecov.io/gh/navidys/oci-spec-zig/branch/main/graph/badge.svg)](https://codecov.io/gh/navidys/oci-spec-zig)\n![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/navidys/oci-spec-zig)\n[![awesome](https://awesome.re/mentioned-badge.svg)](https://github.com/zigcc/awesome-zig)\n\n# oci-spec-zig\nOCI Runtime, Image and Distribution Spec in Zig.\n\nThis library provides a convenient way to interact with the specifications defined by the [Open Container Initiative (OCI)](https://opencontainers.org).\n\n- [Image Format Specification](https://github.com/opencontainers/image-spec/blob/main/spec.md)\n- [Runtime Specification](https://github.com/opencontainers/runtime-spec/blob/master/spec.md)\n- [Distribution Specification](https://github.com/opencontainers/distribution-spec/blob/main/spec.md)\n\n## Requirements\n\nZig version \u003e= 0.14.1\n\n## Installation\n\nFetch latest tagged release or lated build of oci-spec-zs master branch.\n\n```shell\n# Version of oci-spec-zig that works with a tagged release of Zig\n# Replace `\u003cREPLACE ME\u003e` with the version of oci-spec-zig that you want to use\n# See: https://github.com/navidys/oci-spec-zig/releases\nzig fetch --save https://github.com/navidys/oci-spec-zig/archive/refs/tags/\u003cREPLACE ME\u003e.tar.gz\n\n\n# oci-spec-zig latest build (master branch)\nzig fetch --save git+https://github.com/navidys/oci-spec-zig\n```\n\nThen add the following toe build.zig:\n\n```shell\nconst ocispec = b.dependency(\"ocispec\", .{});\nexe.root_module.addImport(\"ocispec\", ocispec.module(\"ocispec\"));\n```\n\n## Example\n\nTo explore additional examples, navigate to the [examples/](./examples/) directory.\n\n```shell\nconst std = @import(\"std\");\nconst ocispec = @import(\"ocispec\");\nconst image = ocispec.image;\n\npub fn main() !void {\n    var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator);\n    defer arena.deinit();\n\n    const allocator = arena.allocator();\n\n    const media_manifest = image.MediaType.ImageManifest;\n    const media_config = image.MediaType.ImageConfig;\n    const media_layer = image.MediaType.ImageLayerGzip;\n\n    var mlayers = std.ArrayList(image.Descriptor).init(allocator);\n    try mlayers.append(image.Descriptor{\n        .mediaType = media_layer,\n        .digest = try image.Digest.initFromString(\n            allocator,\n            \"sha256:9834876dcfb05cb167a5c24953eba58c4ac89b1adf57f28f2f9d09af107ee8f\",\n        ),\n        .size = 32654,\n    });\n\n    const manifest_layers: []image.Descriptor = try mlayers.toOwnedSlice();\n\n    const manifest = image.Manifest{\n        .mediaType = media_manifest,\n        .config = image.Descriptor{\n            .mediaType = media_config,\n            .digest = try image.Digest.initFromString(\n                allocator,\n                \"sha256:b5b2b2c507a0944348e0303114d8d93aaaa081732b86451d9bce1f432a537bc7\",\n            ),\n            .size = 7023,\n        },\n        .layers = manifest_layers,\n    };\n\n    const manifest_content = try manifest.toStringPretty(allocator);\n\n    const stdout_file = std.io.getStdOut().writer();\n    var bw = std.io.bufferedWriter(stdout_file);\n    const stdout = bw.writer();\n\n    try stdout.print(\"{s}\\n\", .{manifest_content});\n\n    try bw.flush();\n}\n```\n\n## License\nLicensed under the [MIT License](https://github.com/navidys/oci-spec-zig/blob/main/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavidys%2Foci-spec-zig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnavidys%2Foci-spec-zig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavidys%2Foci-spec-zig/lists"}