pkger 📦🐳
Package building tool utilizing Docker.
The main purpose of pkger is to automate building .rpm or .deb (perhaps more in the future) packages on multiple operating systems, versions and architectures.
Config
Config file has a following structure:
images_dir = ""
recipes_dir = ""
output_dir = ""
images_dir- directory with images- Each image is a directory containing a
Dockerfileand files to be imported with it - Image name is the directory name
- Each image is a directory containing a
recipes_dir- directory with recipes- Each recipe is a directory containing a
recipe.tomlfile and source files (if not remote)
- Each recipe is a directory containing a
output_dir- directory with built packages- When
pkgerfinishes building the package it will create a directory$output_dir/$os/$ver/where it will put built.rpmor.debpackage.$osand$verare taken from container during build
- When
Recipe
The recipe is divided into 3 parts:
-
Info
- All the metadata and information needed for the build
pkgerwill install all dependencies listed independschoosing the appropriate package manager for each supported distribution.- This recipe will be built for all 3 images
centos,fedora,ubuntu_latest. pkgerwill look for the image directory in f.e.$images_dir/centos.
[info]
name = "curl"
description = "curl"
arch = "x86_64"
license = "null"
version = "7.67.0"
revision = "0"
source = "curl-7.67.0.tar.gz"
depends = ["gcc", "make", "patch", "binutils", "strace"]
exclude = ["share", "info"]
provides = ["curl"]
images = [
"centos",
"fedora",
"ubuntu_latest",
]
-
Build
- All build steps presented as a list of string
[build]
steps = [
"./curl-7.67.0/configure --prefix=/opt/curl/7.67.0",
"make"
]
-
Install
- All install steps presented as a list of string
destdirwhich is the directory where the installed files are. All the steps frombuildandinstallmust result in built files indestdirwhich will then be archived and built into a package.
[install]
steps = ["make install"]
destdir = "/opt/curl/7.67.0"
Usage
To install pkger run cargo install pkger or clone and build this repository with crago build --release.
To use pkger you need a docker daemon running on a tcp port.
After that run:
pkger -d $docker_address -c $config_file [RECIPES]- Substitute
$docker_addresswith address likehttp://0.0.0.0:2376 - Substitute
$config_filewith path to the config file - Add any amount of recipes whitespace separated at the end
To get some informative output run with RUST_LOG=pkger=trace env variable set
Example
Example configuration, recipe and file structure can be found in example directory of master branch