Sign inSign up

alectolytic/rpmbuilder

By alectolytic

•Updated about 1 year ago

RPM build containers for Red Hat based various distros

Image
1

10K+

alectolytic/rpmbuilder repository overview

Quay Container Docker Pulls

⁠RPM build containers for Red Hat based various distros

⁠Available versions

Available versions can be located by visiting Quay Container Repository⁠.

⁠Fetch image
BUILDER_VERSION=centos-7
docker pull quay.io/abn/rpmbuilder:${BUILDER_VERSION}
⁠Run

In this example SOURCE_DIR contains spec file and sources for the the RPM we are building.

# set env variables for conviniece
SOURCE_DIR=$(pwd)/sources
OUTPUT_DIR=$(pwd)/output

# create a output directory
mkdir -p ${OUTPUT_DIR}

# build rpm
docker run --rm -it \
    -v ${SOURCE_DIR}:/sources:z \
    -v ${OUTPUT_DIR}:/output:z \
    -e OUTPUT_USER=$UID \
    quay.io/abn/rpmbuilder:${BUILDER_VERSION}

The output files will be available in OUTPUT_DIR.

⁠Debugging

If you are creating a spec file, it is often useful to have a clean room debugging environment. You can achieve this by using the following command.

docker run --rm -it --entrypoint bash \
    -v ${SOURCE_DIR}:/sources:z \
    -v ${OUTPUT_DIR}:/output:z \
    quay.io/abn/rpmbuilder:${BUILDER_VERSION}

This command will drop you into a bash shell within the container. From here, you can execute build to build the spec file. You can also iteratively modify the specfile and re-run build.

⁠Configuration

The following configurations are available via environment variables

VariableDescription
SOURCESConfigure source directory on the container file system
OUTPUTConfigure output directory on the container file system
RPM_LINTIf set, enables rpm linting once rpms are built
ARCHTarget architecture to build the rpm for, defaults to x86_64

⁠Volumes

The following volumes can be mounted from the host.

VolumeDescription
/sourcesSource to build RPM from
/outputOutput directory where all built RPMs and SRPMs are extracted to

Tag summary

Content type

Image

Digest

sha256:98a5efd3a…

Size

173.2 MB

Last updated

about 1 year ago

docker pull alectolytic/rpmbuilder:rockylinux-9