https://github.com/jc21/docker-rpmbuild-rocky8
https://github.com/jc21/docker-rpmbuild-rocky8
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/jc21/docker-rpmbuild-rocky8
- Owner: jc21
- License: mit
- Created: 2022-09-12T01:10:01.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-07-30T03:19:24.000Z (10 months ago)
- Last Synced: 2025-03-26T01:01:57.799Z (2 months ago)
- Language: Shell
- Size: 12.7 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rocky Linux 8 RPM Build Environment
This container allows you to use your existing RPM build folders but build within the Rocky Linux 8 environment.
The container has:
* EPEL
* Common build packages## Setup
You'll need to create your standard RPM build directory structure as follows:
```
rpmbuild
- BUILD
- BUILDROOT
- RPMS
- SOURCES
- SPECS
- SRPMS
- tmp
```Of course put your spec files in SPECS and your source files in SOURCES.
## Usage
If you want to build just one spec in particular:
```bash
docker run \
--name rpmbuild-rocky8 \
-v /path/to/your/rpmbuild:/home/rpmbuilder/rpmbuild \
--rm=true \
jc21/rpmbuild-rocky8 \
/bin/build-spec /home/rpmbuilder/rpmbuild/SPECS/something.spec
```Or if you want to build all specs in your SPECS folder:
```bash
docker run \
--name rpmbuild-rocky8 \
-v /path/to/your/rpmbuild:/home/rpmbuilder/rpmbuild \
--rm=true \
jc21/rpmbuild-rocky8 \
/bin/build-all
```The build-spec script will go to the trouble of installing any requires that the spec file needs to build.
Built RPMS will show up in the RPMS/SRPMS folders if successful.
## Script it!
Here's an example of wrapping that stuff above in a script. Let's call it build.sh:
```bash
#!/bin/bashSPEC=$1
RPMBUILDROOT=/path/to/your/rpmbuildif [ "$1" == "" ]; then
echo "Usage: build.sh specfile.spec"
exit 1;
else
docker run \
--name rpmbuild-rocky8 \
-v $RPMBUILDROOT:/home/rpmbuilder/rpmbuild \
--rm=true \
jc21/rpmbuild-rocky8 \
/bin/build-spec /home/rpmbuilder/rpmbuild/SPECS/$SPECexit $?
fi
```Then to run it:
```bash
./build.sh something.spec
```## Building with the latest C++ compiler
Devtools-8 is part of this image. To enable it as part of the building process just add the following environment variable to the docker command:
```bash
-e DEVTOOLS=1
```