{"id":16671447,"url":"https://github.com/ikluft/container-buildah","last_synced_at":"2026-04-16T04:33:49.322Z","repository":{"id":56836525,"uuid":"280530801","full_name":"ikluft/Container-Buildah","owner":"ikluft","description":"Container::Buildah Perl module for building OCI/Docker-compatible Linux containers, a wrapper around containers/buildah tool","archived":false,"fork":false,"pushed_at":"2022-10-21T02:01:05.000Z","size":258,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-19T17:37:44.296Z","etag":null,"topics":["containers","linux","perl"],"latest_commit_sha":null,"homepage":"","language":"Perl","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/ikluft.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","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":"2020-07-17T21:45:53.000Z","updated_at":"2021-11-25T02:03:03.000Z","dependencies_parsed_at":"2022-09-09T19:10:53.917Z","dependency_job_id":null,"html_url":"https://github.com/ikluft/Container-Buildah","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ikluft%2FContainer-Buildah","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ikluft%2FContainer-Buildah/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ikluft%2FContainer-Buildah/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ikluft%2FContainer-Buildah/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ikluft","download_url":"https://codeload.github.com/ikluft/Container-Buildah/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243318748,"owners_count":20272137,"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","linux","perl"],"created_at":"2024-10-12T11:44:30.422Z","updated_at":"2025-12-29T04:35:54.525Z","avatar_url":"https://github.com/ikluft.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Container-Buildah\n![Container::Buildah](container-buildah-logo.png \"Container::Buildah\")\nContainer::Buildah Perl module for building OCI/Docker-compatible Linux containers\n\nCPAN: [https://metacpan.org/pod/Container::Buildah](https://metacpan.org/pod/Container::Buildah)\n\n# NAME\n\nContainer::Buildah - wrapper around containers/buildah tool for multi-stage builds of OCI/Docker-compatible Linux containers\n\n# SYNOPSIS\n\n    use \u003cContainer::Buildah\u003e;\n\n        # configure container build stages\n        Container::Buildah::init_config(\n                basename =\u003e \"swpkg\",\n                base_image =\u003e 'docker://docker.io/alpine:[% alpine_version %]',\n                stages =\u003e {\n                        build =\u003e {\n                                from =\u003e \"[% base_image %]\",\n                                func_exec =\u003e \\\u0026stage_build,\n                                produces =\u003e [qw(/opt/swpkg-apk)],\n                        },\n                        runtime =\u003e {\n                                from =\u003e \"[% base_image %]\",\n                                consumes =\u003e [qw(build)],\n                                func_exec =\u003e \\\u0026stage_runtime,\n                                commit =\u003e [\"[% basename %]:[% swpkg_version %]\", \"[% basename %]:latest\"],\n                        }\n                },\n                swpkg_version =\u003e \"9.16.4\",\n        );\n\n        # functions to run each stage inside their container namespaces\n        sub stage_build {\n                my $stage = shift;\n                # code to run inside the namespace of the build container\n                # set up build container and copy newly-built Alpine APK packages into /opt/swpkg-apk ...\n                # See Container::Buildah:Stage for the object passed to each stage function\n        }\n        sub stage_runtime {\n                my $stage = shift;\n                # code to run inside the namespace of the runtime container\n                # set up runtime container including installing Alpine APK packages from /opt/swpkg-apk ...\n                # See Container::Buildah:Stage for the object passed to each stage function\n        }\n\n        # Container::Buildah::main serves as script mainline including processing command-line arguments\n        Container::Buildah::main(); # run all the container stages\n\n# DESCRIPTION\n\n**Container::Buildah** allows Perl scripts to build OCI/Docker-compatible container images using the Open Source\n_buildah_ command. Containers may be pipelined so the product of a build stage is consumed by one or more others.\n\nThe **Container::Buildah** module grew out of a wrapper script to run code inside the user namespace of a\ncontainer under construction. That remains the core of its purpose. It simplifies rootless builds of containers.\n\n**Container::Buildah** may be used to write a script to configure container build stages.\nThe configuration of each build stage contains a reference to a callback function which will run inside the\nuser namespace of the container in order to build it.\nThe function is analagous to a Dockerfile, except that it's programmable with access to computation and the system.\n\nThe _buildah_ command has subcommands equivalent to Dockerfile directives.\nFor each stage of a container build, **Container::Buildah** creates a **Container::Buildah::Stage** object\nand passes it to the callback function for that stage.\nThere are wrapper methods in **Container::Buildah::Stage** for\nsubcommands of buildah which take a container name as a parameter.\n\nThe **Container::Buildah** module has one singleton instance per program.\nIt contains configuration data for a container build process.\nThe data is similar to what would be in a Dockerfile, except this module makes it scriptable.\n\n# METHODS\n\n## status\n\nprints a list of strings to STDERR, if debugging is set to level 1 or higher.\n\n## debug\n\nPrints a list of strings to STDERR, if debugging is at the specified level.\nIf the first argument is a HASH reference, it is used for key/value parameters.\nThe recognized parameters are\n\u0026#x3d;over\n\u0026#x3d;item \"name\" for the name of the caller function, defaults to the name from the Perl call stack\n\u0026#x3d;item \"level\" for the minimum debugging level to print the message\n\u0026#x3d;item \"label\" for an additional label string to enclose in brackets, such as a container name\n\u0026#x3d;back\n\n## get\\_config\n\n## required\\_config\n\n## get\\_debug\n\nReturn integer value of debug level\n\n## set\\_debug\n\nTake an integer value parameter to set the debug level. A level of 0 means debugging is turned off. The default is 0.\n\n## main\n\n## prog\n\n## cmd\n\n## buildah\n\n## bud\n\n## containers\n\n## from\n\n## images\n\n## info\n\n## inspect\n\n## mount\n\n## pull\n\n## push\n\n## rename\n\n## rm\n\n## rmi\n\n## tag\n\n## umount\n\n## unshare\n\n## version\n\n# FUNCTIONS\n\n## init\\_config\n\n# FUNCTIONS AND METHODS\n\n## Container::Buildah core functions and methods\n\n## methods provided by Container::Buildah::Subcommand\n\n# BUGS AND LIMITATIONS\n\nPlease report bugs via GitHub at [https://github.com/ikluft/Container-Buildah/issues](https://github.com/ikluft/Container-Buildah/issues)\n\nPatches and enhancements may be submitted via a pull request at [https://github.com/ikluft/Container-Buildah/pulls](https://github.com/ikluft/Container-Buildah/pulls)\n\nContainers can only be run with a Linux kernel revision 2.8 or newer.\n\n# AUTHOR\n\nIan Kluft \u0026lt;https://github.com/ikluft\u003e\n\n# COPYRIGHT AND LICENSE\n\nThis software is Copyright (c) 2020 by Ian Kluft.\n\nThis is free software, licensed under:\n\n    The Apache License, Version 2.0, January 2004\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fikluft%2Fcontainer-buildah","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fikluft%2Fcontainer-buildah","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fikluft%2Fcontainer-buildah/lists"}