dbuild is a docker based build system to facilitate linux package generation.
- Create a docker container for each platform specified.
- Install specified dependencies using the platforms package manager.
- Execute the user specified compilation and package generation script.
- Populate the builds directory with an installation package for each platform specified.
dbuild will not:
- Solve dependency hell.
- Test resulting packages (yet)
dbuild should be installed globally with,
$ npm install dbuild -g
A typical dbuild directory structure is as follows,
project_root||-- source_dir| |- source files|-- log_dir *| |- build log files|-- builds_dir *| |- built packages|-- dbuild.json|-- dbuild.sh
(*) log and builds directories will be created automatically if they do not already exist.
dbuild may be invoked from the project root to build for all specified platforms with,
or for a specific platform (which is specified in dbuild.json)
$ dbuild -p ubuntu:17.10
or for all versions of the same platform (which are specified in dbuild.json)
$ dbuild -p ubuntu
or for multiple independent platforms,
$ dbuild -p ubuntu:17.10 -p centos:7
The dbuild.json specifies,
- Package metadata
- Which platforms to build packages for
- The package dependencies (Note: name only, version is controlled by linux distribution)
- The relative path to source, log, and builds directories
Use the sample dbuild.json to get started,
Platforms are specified according to whether they are apt or yum based. Support for other platforms may be added in future (Create an issue if you require other platforms)
Platform names are given corresponding to those available on Docker Hub.
The dependencies array must give the name of a dependency at a minimum. If no other aliases are specified dbuild will attempt to install this dependency using this name. Package aliases may be specified either by package manager name, platform name, or platform name and version.
This script should compile the source code and create the output package. The following environment variables may be used,
|SOURCE_DIR||Path to the source code directory|
|BUILDS_DIR||Path to the builds directory|
|LOG_DIR||Path to the log directory|
|PACKAGE_TYPE||RPM or DEB depending on platform|
This directory must be included and specified by the user.