{"id":15870820,"url":"https://github.com/khos2ow/cloudstack-rpm-builder","last_synced_at":"2025-08-12T23:32:36.541Z","repository":{"id":32288871,"uuid":"123756618","full_name":"khos2ow/cloudstack-rpm-builder","owner":"khos2ow","description":"Docker images for building Apache CloudStack RPM packages","archived":false,"fork":false,"pushed_at":"2021-11-23T16:57:51.000Z","size":59,"stargazers_count":1,"open_issues_count":1,"forks_count":11,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-27T07:50:02.563Z","etag":null,"topics":["apache","apache-cloudstack","centos","centos6","centos7","cloudstack","docker"],"latest_commit_sha":null,"homepage":"https://khos2ow.github.io/cloudstack-rpm-builder/","language":"Shell","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/khos2ow.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2018-03-04T04:26:38.000Z","updated_at":"2022-05-09T06:52:27.000Z","dependencies_parsed_at":"2022-08-07T17:15:46.793Z","dependency_job_id":null,"html_url":"https://github.com/khos2ow/cloudstack-rpm-builder","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khos2ow%2Fcloudstack-rpm-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khos2ow%2Fcloudstack-rpm-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khos2ow%2Fcloudstack-rpm-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khos2ow%2Fcloudstack-rpm-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/khos2ow","download_url":"https://codeload.github.com/khos2ow/cloudstack-rpm-builder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229717773,"owners_count":18113394,"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":["apache","apache-cloudstack","centos","centos6","centos7","cloudstack","docker"],"created_at":"2024-10-06T00:23:42.287Z","updated_at":"2024-12-14T14:42:41.661Z","avatar_url":"https://github.com/khos2ow.png","language":"Shell","readme":"# CloudStack RPM Package builder using Docker\n\n[![Build Status](https://github.com/khos2ow/cloudstack-rpm-builder/workflows/ci/badge.svg)](https://github.com/khos2ow/cloudstack-rpm-builder/actions)\n[![Docker Pulls](https://img.shields.io/docker/pulls/khos2ow/cloudstack-rpm-builder.svg)](https://store.docker.com/community/images/khos2ow/cloudstack-rpm-builder)\n[![license](https://img.shields.io/github/license/khos2ow/cloudstack-rpm-builder.svg)](https://github.com/khos2ow/cloudstack-rpm-builder/blob/master/LICENSE)\n\nDocker images for building Apache CloudStack RPM packages.\n\nThis will give portable, immutable and reproducable mechanism to build packages\nfor releases. A very good candidate to be used by the Jenkins slaves of the\nproject.\n\n## Table of Contents\n\n- [Supported tags and respective `Dockerfile` links](#supported-tags-and-respective-dockerfile-links)\n- [Packages installed in container](#packages-installed-in-container)\n- [Build RPM packages](#build-rpm-packages)\n  - [Pull Docker images](#pull-docker-images)\n  - [Build local repository](#build-local-repository)\n    - [Clone Apache CloudStack source code](#clone-apache-cloudstack-source-code)\n    - [Build packages of local repository](#build-packages-of-local-repository)\n  - [Build remote repository](#build-remote-repository)\n    - [Build packages of remote repository](#build-packages-of-remote-repository)\n- [Building tips](#building-tips)\n  - [Maven cache](#maven-cache)\n  - [Adjust host owner permission](#adjust-host-owner-permission)\n- [Builder help](#builder-help)\n- [License](#license)\n\n## Supported tags and respective `Dockerfile` links\n\n- [`latest`, `latest-jdk8`, `centos7`, `centos7-jdk8`(centos7/Dockerfile.jdk8)][centos7-dockerfile]\n- [`latest-jdk11`, `centos7-jdk11` (centos7/Dockerfile.jdk11)][latest-jdk11-dockerfile]\n- [`centos6` (centos6/Dockerfile)][centos6-dockerfile] [EOL - not supported anymore]\n\n## Packages installed in container\n\nList of available packages inside the container:\n\n- rpm-build\n- yum-utils\n- createrepo\n- mkisofs\n- git\n- java (JDK 8 or JDK 11)\n- maven 3.5\n- tomcat\n- python\n- python3\n- locate\n- which\n- nodejs\n\n## Build RPM packages\n\nBuilding RPM packages with the Docker container is rather easy, a few steps are\nrequired:\n\n### Pull Docker images\n\nLet's assume we want to build packages for CentOS 7 on CentOS 7. We pull that\nimage first:\n\n```bash\ndocker pull khos2ow/cloudstack-rpm-builder:centos7-jdk11\n```\n\nYou can replace `centos7-jdk11` tag by [one of the other tags].\n\n### Build local repository\n\nYou can clone the CloudStack source code from repository locally on your machine\nand build packages against that.\n\n#### Clone Apache CloudStack source code\n\nThe first step required is to clone the CloudStack source code somewhere on the\nfilesystem, in `/tmp` for example:\n\n```bash\ngit clone https://github.com/apache/cloudstack.git /tmp/cloudstack\n```\n\nNow that you have done so we can continue.\n\n#### Build packages of local repository\n\nNow that we have cloned the CloudStack source code locally, we can build packages\nby mapping `/tmp` into `/mnt/build` in the container. (Note that the container\nalways expects the `cloudstack` code exists in `/mnt/build` path.)\n\n```bash\ndocker run \\\n    -v /tmp:/mnt/build \\\n    khos2ow/cloudstack-rpm-builder:centos7-jdk11 --distribution centos7 [ARGS...]\n```\n\nOr if your local cloudstack folder has other name, you need to map it to\n`/mnt/build/cloudstack`.\n\n```bash\ndocker run \\\n    -v /tmp/cloudstack-custom-name:/mnt/build/cloudstack \\\n    khos2ow/cloudstack-rpm-builder:centos7-jdk11 --distribution centos7 [ARGS...]\n```\n\nAfter the build has finished the `.rpm` packages are available in\n`/tmp/cloudstack/dist/rpmbuild/RPMS` on the host system.\n\n### Build remote repository\n\nAlso you can build RPM packages of any remote repository without the need to manually\nclone it first. You only need to specify git remote and git ref you intend to build\nfrom.\n\n#### Build packages of remote repository\n\nNow let's assume we want to build packages of `HEAD` of `master` branch from\n[https://github.com/apache/cloudstack] repository, we build packages by mapping\n`/tmp` into `/mnt/build` in the container. The container will clone the repository\n(defined by `--git-remote` flag) and check out the REF (defined by `--git-ref`\nflag) in `/mnt/build/cloudstack` inside the container and can be accessed from\n`/tmp/cloudstack` from the host machine.\n\n```bash\ndocker run \\\n    -v /tmp:/mnt/build \\\n    khos2ow/cloudstack-rpm-builder:centos7-jdk11 \\\n        --git-remote https://github.com/apache/cloudstack.git \\\n        --git-ref master \\\n        --distribution centos7 [ARGS...]\n```\n\nNote that any valid git Refspec is acceptable, such as:\n\n- `refs/heads/\u003cBRANCH\u003e` to build specified Branch\n- `\u003cBRANCH\u003e` short version of build specified Branch\n- `refs/pull/\u003cNUMBER\u003e/head` to build specified GitHub Pull Request\n- `refs/merge-requests/\u003cNUMBER\u003e/head` to build specified GitLab Merge Request\n- `refs/tags/\u003cNAME\u003e` to build specified Tag\n\nAfter the build has finished the `.rpm` packages are available in\n`/tmp/cloudstack/dist/rpmbuild/RPMS` on the host system.\n\n## Building tips\n\nCheck the following tips when using the builder:\n\n### Maven cache\n\nYou can provide Maven cache folder (`~/.m2`) as a volume to the container to make\nit run faster.\n\n```bash\ndocker run \\\n    -v /tmp:/mnt/build \\\n    -v ~/.m2:/root/.m2 \\\n    khos2ow/cloudstack-rpm-builder:centos7-jdk11 --distribution centos7 [ARGS...]\n```\n\n### Adjust host owner permission\n\nBuilder container in some cases (e.g. using `--use-timestamp` flag) may change\nthe file and directory owner shared from host to container (through volume) and\nit will create `dist` directory which holds the final artifacts. You can provide\n`USER_ID` (mandatory) and/or `USER_GID` (optional) from host to adjust the owner\nfrom whitin the container.\n\nThis is specially useful if you want to use this image in Jenkins job and want to\nclean up the workspace afterward. By adjusting the owner, you won't need to give\nyour Jenkins' user `sudo` privilege to clean up.\n\n```bash\ndocker run \\\n    -v /tmp:/mnt/build \\\n    -e \"USER_ID=$(id -u)\" \\\n    -e \"USER_GID=$(id -g)\" \\\n    khos2ow/cloudstack-rpm-builder:centos7-jdk11 --distribution centos7 [ARGS...]\n```\n\n## Builder help\n\nTo see all the available options you can pass to `docker run ...` command:\n\n```bash\ndocker run \\\n    -v /tmp:/mnt/build \\\n    khos2ow/cloudstack-rpm-builder:centos7-jdk11 --help\n```\n\n## License\n\nLicensed under [Apache License version 2.0]. Please see the [LICENSE] file\nincluded in the root directory of the source tree for extended license details.\n\n[centos7-dockerfile]: https://github.com/khos2ow/cloudstack-rpm-builder/blob/master/centos7/Dockerfile.jdk8\n[latest-jdk11-dockerfile]: https://github.com/khos2ow/cloudstack-rpm-builder/blob/master/centos7/Dockerfile.jdk11\n[centos6-dockerfile]: https://github.com/khos2ow/cloudstack-rpm-builder/blob/master/centos6/Dockerfile\n[one of the other tags]: #supported-tags-and-respective-dockerfile-links\n[https://github.com/apache/cloudstack]: https://github.com/apache/cloudstack\n[Apache License version 2.0]: http://www.apache.org/licenses/LICENSE-2.0\n[LICENSE]: https://github.com/khos2ow/cloudstack-rpm-builder/blob/master/LICENSE\n","funding_links":[],"categories":["Development"],"sub_categories":["Build with Docker"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhos2ow%2Fcloudstack-rpm-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhos2ow%2Fcloudstack-rpm-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhos2ow%2Fcloudstack-rpm-builder/lists"}