{"id":19407636,"url":"https://github.com/termoshtt/ocipkg","last_synced_at":"2025-05-08T00:33:23.969Z","repository":{"id":37007655,"uuid":"315636236","full_name":"termoshtt/ocipkg","owner":"termoshtt","description":"An OCI registry client for Rust desiged to use distribute static library as a \"container\"","archived":false,"fork":false,"pushed_at":"2024-05-01T12:12:55.000Z","size":1599,"stargazers_count":43,"open_issues_count":23,"forks_count":8,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-05-02T00:38:29.410Z","etag":null,"topics":["docker","oci","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/termoshtt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE-APACHE","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},"funding":{"github":["termoshtt"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-11-24T13:11:19.000Z","updated_at":"2024-06-05T07:02:05.132Z","dependencies_parsed_at":"2024-04-04T19:29:56.536Z","dependency_job_id":"d96f036b-e3f8-47a1-a100-9845965d452c","html_url":"https://github.com/termoshtt/ocipkg","commit_stats":{"total_commits":351,"total_committers":2,"mean_commits":175.5,"dds":0.002849002849002802,"last_synced_commit":"8f98b8f88fb737896dfb1a9438f6f20e8a70457d"},"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/termoshtt%2Focipkg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/termoshtt%2Focipkg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/termoshtt%2Focipkg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/termoshtt%2Focipkg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/termoshtt","download_url":"https://codeload.github.com/termoshtt/ocipkg/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225106472,"owners_count":17421804,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["docker","oci","rust"],"created_at":"2024-11-10T12:03:20.287Z","updated_at":"2024-11-18T00:06:27.869Z","avatar_url":"https://github.com/termoshtt.png","language":"Rust","funding_links":["https://github.com/sponsors/termoshtt"],"categories":["Rust"],"sub_categories":[],"readme":"ocipkg\n=======\n\n[![crate](https://img.shields.io/crates/v/ocipkg.svg)](https://crates.io/crates/ocipkg) \n[![docs.rs](https://docs.rs/ocipkg/badge.svg)](https://docs.rs/ocipkg)\n[![master](https://img.shields.io/badge/docs-master-blue)](https://termoshtt.github.io/ocipkg/ocipkg/index.html)\n\nOCI Registry for package distribution.\n\nFeatures\n---------\n\nocipkg is designed as a thin OCI registry client:\n\n- Read and Write oci-archive format (tar archive of [OCI Image Layout](https://github.com/opencontainers/image-spec/blob/main/image-layout.md)).\n- Push and Pull container images to OCI registry without external container runtime, e.g. docker or podman\n\nIn addition, ocipkg provides utilities for using OCI registry for package distribution:\n\n- CLI tool for building containers from files, directory,\n  and Rust project with `Cargo.toml` metadata.\n- `build.rs` helper for getting and linking library file (`*.a` or `*.so`) as a container\n\nWhy ocipkg?\n-------------\nI have determined to start this project while writing FFI crate in Rust.\nThe problem is \"how to get a share/static library linked to FFI crate\".\nThis is the problem bothered me and prevent from creating portable C++ library.\n\nWe have three options:\n\n1. Use library in the system\n    - ✔ Library is prepared by the system administrator who would be most familiar with the system.\n    - ❌ Developer have to know how the library is distributed in user's system,\n         possibly Ubuntu 22.04, 20.04, 18.04, Debian sid, 11, 10, 9, RHEL9, 8, 7,\n         ArchLinux, Gentoo Linux, FreeBSD,\n         macOS with brew, Windows with winget, chocolatey, scoop, ...\n    - ❌ Some system does not allows co-existence of multi-version libraries.\n    - Most of `*-sys` crate support this option.\n2. Get source code from the internet, and build and link them\n    - ✔ Developer can control the library fully.\n    - ❌ Development tool, e.g. `cmake`, is required in user system,\n         and requires additional build resources.\n    - Some crate support this option, and they are named with `*-src`.\n3. Get compiled library from the internet on build time\n    - ✔ Developer can control the library fully, too.\n    - ❌ Requires HTTP(or other protocol) server to distribute the library\n    - ❌ Developer have to ready binaries for every supported platforms,\n         e.g. `x86_64-unknown-linux-gnu`, `x86_64-pc-windows-msvc`, `aarch64-unknown-linux-gnu`,...\n\nocipkg focuses on the option 3., i.e. helping distributing binary compiled\nby the developer through OCI registry.\n\nExamples\n---------\n\nRust\n\n- Create package: [examples/rust/lib](./examples/rust/lib)\n- Use package: [examples/rust/exe](./examples/rust/exe)\n\nC++/cmake\n\n- Create package: [examples/cpp/lib](./examples/cpp/lib)\n\nCLI tools\n----------\n\n### Install\n\n```bash\ncargo install ocipkg-cli\n```\n\n### `ocipkg` command\n\nTBW\n\n### `cargo-ocipkg` command\n\nA tool for creating and publishing container consists of\nstatic or dynamic library built by `cargo build`:\n\n```\n$ cargo ocipkg build --release\n    Finished release [optimized] target(s) in 0.00s\n    Creating oci-archive (/home/teramura/github.com/termoshtt/ocipkg/examples/dynamic/rust/lib/target/release/ocipkg_dd0c7a812fd0fcbc.tar)\n```\n\nThe filename is in form of `ocipkg_{{ hash }}.tar`,\nand this hash is calculated from image name and `Cargo.toml`.\n\nContainer image name is determined using git commit hash\nas `{{ registry }}:$(git rev-parse HEAD --short)`\nwhere registry name is set by `Cargo.toml`:\n\n```toml\n[package.metadata.ocipkg]\nregistry = \"ghcr.io/termoshtt/ocipkg/dynamic/rust\"\n```\n\nThis container can be published by `cargo-ocipkg publish`:\n\n```\n$ cargo ocipkg publish --release\n     Publish container (ghcr.io/termoshtt/ocipkg/dynamic/rust:be7f108)\n```\n\nLinks\n------\n\n[Open Container Initiative (OCI)](https://opencontainers.org/) is a project under [Linux Foundation](https://www.linuxfoundation.org/).\n\n- [OCI Image Format Specification](https://github.com/opencontainers/image-spec)\n- [OCI Distribution Specification](https://github.com/opencontainers/distribution-spec)\n\nThis project does not depend on [OCI Runtime specification](https://github.com/opencontainers/runtime-spec)\nsince we never run a container.\n\nThe idea that distribute any files (not a system image) using OCI registry is based on [ORAS][oras].\n\n- [OCI Registry As Storage][oras]\n\n[oras]: https://oras.land/\n\nSimilar projects trying to distribute packages using OCI registries:\n\n- [OCI transport plugin for apt-get](https://github.com/AkihiroSuda/apt-transport-oci)\n- [Homebrew](https://github.com/orgs/Homebrew/packages)\n\nLicense\n--------\n\n© 2020 Toshiki Teramura (@termoshtt)\n\nThis project is licensed under either of\n\n- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0)\n- MIT license ([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT)\n\nat your option.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftermoshtt%2Focipkg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftermoshtt%2Focipkg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftermoshtt%2Focipkg/lists"}