Code Monkey home page Code Monkey logo

docker-rpmbuild-centos7's Introduction

Centos 7 RPM Build Environment

This container allows you to use your existing RPM build folders but build within the Centos 7 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:

sudo docker run \
    --name rpmbuild-centos7 \
    -v /path/to/your/rpmbuild:/home/rpmbuilder/rpmbuild \
    --rm=true \
    jc21/rpmbuild-centos7 \
    /bin/build-spec /home/rpmbuilder/rpmbuild/SPECS/something.spec

Or if you want to build all specs in your SPECS folder:

sudo docker run \
    --name rpmbuild-centos7 \
    -v /path/to/your/rpmbuild:/home/rpmbuilder/rpmbuild \
    --rm=true \
    jc21/rpmbuild-centos7 \
    /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:

#!/bin/bash

SPEC=$1
RPMBUILDROOT=/path/to/your/rpmbuild

if [ "$1" == "" ]; then
    echo "Usage: build.sh specfile.spec"
    exit 1;
else
    sudo docker run \
        --name rpmbuild-centos7 \
        -v $RPMBUILDROOT:/home/rpmbuilder/rpmbuild \
        --rm=true \
        jc21/rpmbuild-centos7 \
        /bin/build-spec /home/rpmbuilder/rpmbuild/SPECS/$SPEC

    exit $?
fi

Then to run it:

./build.sh something.spec

Building with the latest C++ compiler

Devtools-7 is part of this image. To enable it as part of the building process just add the following environment variable to the docker command:

-e DEVTOOLS=1

docker-rpmbuild-centos7's People

Contributors

jc21 avatar jstaffans avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.