Leverage fpm inside pre-baked docker images in order to build and test native DEB and RPM packages.
VERY IMPORTANT NOTICE: because of time constraints, I'll keep this updated for Centos, Debian and Ubuntu LTS. Fedora and Ubuntu intermediate releases will be dropped. If I'm lagging behind, please open a ticket.
Pre-baked images for RPM and DEB package building. fpm is included!
All images are updated to the latest FPM version, currently: 1.13.1.
Do you like this project? Is it useful to you? If you'd like to reward me, donate something from my wish list
If you don't want to spend your nights in learning packaging an RPM or a DEB - which is a good idea - FPM can help. But, out of the box, fpm doesn't provide a "sandbox" or any other "isolated environment" for building. Here comes this set of images.
You should still know something about package building.
For RPM see Maximum RPM, Fedora RPM Howto, or Fedora RPM Guide.
For DEB, see Debian How To Package or Ubuntu Packaging New Software.
You'd better know what docker is, as well.
I recommend you take a look at the example in the example project directory - it's an example build of a lua interpreter for Centos7 and Ubuntu Trusty. The directory contains the extracted source of lua 5.3.1, while the packaging dir contains our build scripts. The main build scripts are commented and will tell you what you should know: see build for centos 7 and build for ubuntu trusty
The build chain goes something like this:
pip install
or gem install
for your project dependencies. Although that could provide faster build speed, it will mingle OS dependencies with project level dependencies, and later it could happen that your project builds even though you forgot a dependency in your project file.I suggest you just copy the whole packaging directory from the examples to your own project, then you add/remove the various distro-related subdirectories and modify them in place.
I don't necessarily include apt-current anymore.
Currently the images are x86_64 only. There's an exception for centos5 i386, since I had an actual use case, but its creation was very tedious, and docker doesn't officially endorse 32 bit guests.
I'll add 32 bit images only if help is provided.
Fpm supports signing rpms, but there's a minimum of setup involved; check the build for centos 7 to see how it's done. You can both sign and verify the signature is OK.
WARNING: I retained some RPM macros that used to be necessary in Centos 6 and 7 in Centos 8, but I haven't actually tested proper signing with such distro. If signing fails, please open an issue.
DEB packages are signed in the repository only, so no issue while building.
They're available on Docker hub, so they can be used straight from your docker command line, without the need of rebuilding them locally.
fpm-within-docker images on Docker Hub
All images are are x86_64 only. Please note: some older images may exist on docker hub, but if they're not listed down there, consider them unsupported.
I'll usually add images for Centos, Fedora, Ubuntu and Debian as soon as they get out, and I'll try supporting them as long as they're supported upstream.
Available images:
alanfranz/fpm-within-docker:centos-7
alanfranz/fpm-within-docker:centos-8
alanfranz/fpm-within-docker:debian-stretch
alanfranz/fpm-within-docker:debian-bullseye
alanfranz/fpm-within-docker:ubuntu-xenial
alanfranz/fpm-within-docker:ubuntu-bionic
alanfranz/fpm-within-docker:ubuntu-focal