Container images that includes support tools to builds RPMs for CentOS
docker build -t idi-ops/centos-rpm-builder .
Environment variables must be specified at run time for the container to function:
PACKAGE_NAME
: required: name of the package to build (should match specfile for the package repo)PACKAGE_REPO
: required: URL of GitHub repo to pull the package fromOUTPUT_DIR
: required: output directory on Docker container to store packages. Typically, you'll want to bind this to a host volume as well to keep the outputted packages.DEPS_DIR
: optional: directory of dependency local packages to install before building the package (this can use packages from the host system with volume binding, as shown below)
mkdir output
docker run --rm -v $PWD/output:/pkgs -it \
-e PACKAGE_NAME=erlang-mochiweb \
-e PACKAGE_REPO=https://github.com/gtirloni/rpm-centos-mochiweb \
-e OUTPUT_DIR=/pkgs \
idi-ops/centos-rpm-builder
docker run --rm -v $PWD/output:/pkgs -it \
-e PACKAGE_NAME=couchdb \
-e PACKAGE_REPO=https://github.com/gtirloni/rpm-centos-couchdb \
-e OUTPUT_DIR=/pkgs \
-e DEPS_DIR=/pkgs \
idi-ops/centos-rpm-builder
docker run --rm -v $PWD/output:/pkgs -it
-e OUTPUT_DIR=/pkgs
idi-ops/centos-rpm-builder