{"id":21284483,"url":"https://github.com/nasdaq/oci-injector-hook","last_synced_at":"2025-07-11T11:31:55.510Z","repository":{"id":57657754,"uuid":"225071452","full_name":"Nasdaq/oci-injector-hook","owner":"Nasdaq","description":"Inject files and devices into OCI containers","archived":false,"fork":false,"pushed_at":"2019-12-30T17:39:20.000Z","size":58,"stargazers_count":8,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-07T18:22:45.086Z","etag":null,"topics":["containers","golang","oci","oci-runtime"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/Nasdaq.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-30T21:23:10.000Z","updated_at":"2024-05-07T18:22:45.086Z","dependencies_parsed_at":"2022-09-14T08:00:51.890Z","dependency_job_id":null,"html_url":"https://github.com/Nasdaq/oci-injector-hook","commit_stats":null,"previous_names":["gclawes/oci-injector-hook"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nasdaq%2Foci-injector-hook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nasdaq%2Foci-injector-hook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nasdaq%2Foci-injector-hook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nasdaq%2Foci-injector-hook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nasdaq","download_url":"https://codeload.github.com/Nasdaq/oci-injector-hook/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225715851,"owners_count":17512912,"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":["containers","golang","oci","oci-runtime"],"created_at":"2024-11-21T11:16:09.636Z","updated_at":"2024-11-21T11:16:10.307Z","avatar_url":"https://github.com/Nasdaq.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# oci-injector-hook\n\nIt is sometimes useful to inject platform-specific files and devices into an OCI container at runtime.\nCommon use cases include device drivers (GPUs, network adapters, FPGAs, etc).\nThis hook uses the [POSIX-platform Hooks](https://github.com/opencontainers/runtime-spec/blob/master/config.md#posix-platform-hooks) from the OCI Runtime Spec to inject these files into a container's rootfs before the container is started.\n\n## Supported File Types\n* Devices (not yet implemented) - Device files under /dev/\n* Directories - create directories in the container rootfs\n* Binaries - exectuable binaries\n* Libraries - library files (updates ld.so.cache)\n* Miscellaneous - ordinary files to copy in (chmod +x/ldconfig not required)\n\n\n## Configuration\nConfigurations are definied in .json files placed in the `/etc/oci-injector-hook/` directory.  Each configuration has an `activation_flag`, which indicates an environment variable that must be present in the container's environment for the hook to execute.\n\nThe `activation_flag` can either be the name of an environment variable (`VAR`) or a variable with a value (`VAR=value`).\nWhen a name is given the hook will run when the environment variable is present, when a variable with a value is given the hook will only run when the variable is present with the given value.\n\nAn example configuration file:\n`/etc/oci-injector-hook/foo.json`\n```\n{\n  \"activation_flag\": \"OCI_FOO\",\n  \"devices\": [ \"/dev/foo\" ],\n  \"binaries\": [ \"/usr/bin/runfoo\" ],\n  \"libraries\": [ \"/usr/lib64/libfoo.so\" ],\n  \"directories\": [ \"/etc/foo\" ],\n  \"miscellaneous\": [ \"/etc/foo/config.json\" ]\n}\n```\n\n## License\nThis project is licensed under the Apache-2.0 License\n\n## Inspiration\nThis project was inspired by work done in the following projects to support SolarFlare Network Adapters:\n* https://github.com/zvonkok/oci-decorator\n* https://github.com/solarflarecommunications/sfc-k8s-prestart-hook\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnasdaq%2Foci-injector-hook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnasdaq%2Foci-injector-hook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnasdaq%2Foci-injector-hook/lists"}