Coder Social home page Coder Social logo

deber's Introduction

deber

GoDoc go report card latest tag

Debian + Docker = deber

Utility made with simplicity in mind to provide an easy way for building Debian packages in Docker containers.

Screencast

asciicast

Features

  • Build packages for Debian and Ubuntu
  • Use official Debian and Ubuntu images from DockerHub
  • Automatically determine if target distribution is Ubuntu or Debian by querying DockerHub API
  • Skip already ran steps (not every one)
  • Install extra local packages in container
  • Plays nice with gbp-buildpackage
  • Easy local package dependency resolve
  • Don't clutter your parent directories with .deb, .dsc and company
  • Every successfully built package goes to local repo automatically so you can easily build another package that depends on previous one
  • Ability to provide custom dpkg-buildpackage and lintian options
  • Packages downloaded by apt are stored in temporary directory, to avoid repetitive unnecessary network load
  • Option to drop into interactive bash shell session in container, for debugging or other purposes
  • Use network in build process or not
  • Automatically rebuilds image if old enough

Installation

Homebrew

brew install dawidd6/tap/deber

Source

go install github.com/dawidd6/deber@latest

Usage

I recommend to use deber with gbp if possible, but it will work just fine as a standalone builder, like sbuild or pbuilder.

Let's assume that you are in directory with already debianized source, have orig upstream tarball in parent directory and you want to build a package. Just run:

deber

or if you use gbp and have builder = deber in gbp.conf

gbp buildpackage

If you run it first time, it will build Docker image and then proceed to build your package.

To make use of packages from archive to build another package, specify desired directories with built artifacts and deber will take them to consideration when installing dependencies:

deber -p ~/deber/unstable/pkg1/1.0.0-1 -p ~/deber/unstable/pkg2/2.0.0-2

FAQ

Okay everything went well, but... where the hell is my .deb?!

The location for all build outputs defaults to $HOME/deber. I made it this way, because it was just hard to look at my parent directory, cluttered with .orig.tar.gz, .deb, .changes and God knows what else.

Where is build directory located?

/tmp/$CONTAINER

Where is apt's cache directory located?

/tmp/$IMAGE

How images built by deber are named?

deber:$DIST

I have already built image but it is building again?!

Probably because it is 14 days old and deber decided to update it.

How to build a package for different distributions?

Make a new entry with desired target distribution in debian/changelog and run deber.

Or specify the desired distribution with --distribution option.

How to cross-build package for different architecture?

This is not implemented yet. But I'm planning to make use of qemu or something else.

CONTRIBUTING

I appreciate any contributions, so feel free to do so!

deber's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

deber's Issues

Logos licensing

Mention original authors with licenses of Docker, Debian and Go logos

Scan after archiving

Run scan step after archive.

Seems to be better option, because this way the Packages file is always up-to-date.

Add option to pass build directory

Having /home and /tmp on separate BTRFS subvolumes, deber fails at Finding tarballs step with:

deber:error: rename /home/<user>/<package> /tmp/<container>/<package>: invalid cross-device link

It would be nice to have the option to pass the build directory as argument. Thanks!

Move to archive anyway

Don't skip this step if package is present in archive.

Why?

Just cause package is building successfuly doesn't mean it's good in every aspect.

Options after '--'

Arguments after -- will be threated as options passed to dpkg-buildpackage.

New CLI

  • build
    • --rebuild
  • create
    • --recreate
  • deps
    • --packages
  • package
    • --network
  • test
    • --network
    • --lintian
  • remove
  • shell
  • status
  • list
    • --containers
    • --images
    • --packages

Comment on packages

// Package xyz provides something and something else...
//
// Stuff like that.
package xyz

"Invalid cross-device link" error

Deber seems to be failing when creating a hard link for the orig tarball of my package. Perhaps deber should fall back to copying when linking fails.

Tried on Manjaro using the AUR package for Deber. Source tarball is on a /@home btrfs subvolume.

Not enough arguments in call to docker.cli.ContainerCreate

Greetings! I'm trying to install deber:

(base) [sm@fedora-mbp bmxlib-libmxf]$ go get -u github.com/dawidd6/deber
# github.com/dawidd6/deber/pkg/docker
/home/sm/go/pkg/mod/github.com/dawidd6/[email protected]/pkg/docker/container.go:130:38: not enough arguments in call to docker.cli.ContainerCreate
	have (context.Context, *container.Config, *container.HostConfig, nil, string)
	want (context.Context, *container.Config, *container.HostConfig, *network.NetworkingConfig, *v1.Platform, string)

Am I doing something wrong or is it a bug?

Disabling network

Seems like network disabling is buggy, cause sometimes when build flow is broken, every new Docker container has no internet access.

Debian backports

Ubuntu Docker image already contains backports repo, but Debian doesn't.

Maybe make an exception for Debian?

Checking if changelog line contains ~bpo should be enough I guess, to determine
that it is Debian backport since Ubuntu does not use this notation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.