Modularity-tools

Requirements

Following packages are required: * python2-pytest

modtools docker2openshift

The tool is used for generation OpenShift template from Dockerfile and from https://github.com/container-images/container-image-template/blob/master/openshift-template.yml already prepared by Modularity team. As Dockerfile as openshift-template.yml have to exist in the directory.

How to use modtools docker2openshift

Run the command with following parameters:

./modtools docker2openshift --dockerfile <full_path_to_Dockerfile> IMAGENAME

where parameters mean: * dockerfile ... means full path to Dockerfile * IMAGENAME ... means image name in register. Can be taken from command docker images or from some other registry.

The output of modtools docker2openshift command is OpenShift template stored in temporary directory

Example usage:

   ./modtools docker2openshift --dockerfile path/to/Dockerfile image/repository/url
/path/to/Dockerfile
   OpenShift template is generated here: /tmp/tmpM0teUC/openshift-template.yml

modtools module2dockerfile

The tool exists to ease creation of module related Dockerfiles. It pre-filles the information from modulemd file, but be aware, the generated Dockerfile needs to be manualy extended by other info (configuration, volumes, etc.).

How to use modtools module2dockerfile

Run the command with following parameters:

./modtools module2dockerfile --template <dockerfile_template> MODULEMD_FILE

where parameters mean: * template - base for Dockerfile, if you don't want otherwise use this file: https://github.com/container-images/container-image-template/blob/master/Dockerfile.template * modulemd.yaml - path to the modulemd file

How to run tests

In order to run tests, run command:

py.test-2.7 tests/

Modulemd creation

modtools rpm2module script creates modulemd file from package names. Output is written in modulemd-output.yaml file (multiple packages as input) or in file named after package name (single package as input).

Please make sure you have latest module-build-service and dnf installed before running.