Coder Social home page Coder Social logo

debpic's Introduction

DEBPIC: DEbian Build Package In Container

alt text
debpic Code style: black codecov License: LGPL v3

Introduction

Debpic lets you build Debian packages in an isolated Docker environment.

See the man page for an introduction and usage instructions.

The Debian wiki has a list of similar tools.

Overview

Tasks Steps
Build debpic
Interactive mode debpic --interactive
Open VSCode in container debpic --vscode
Local Apt Repository debpic --local-repository ~/mydebs
Private Apt Repository (Configure) Write deb822 format sources to /etc/debpic/sources.list.d/MyServer
Private Apt Repository (Use) debpic --sources MyServer
Use DEB_BUILD_OPTIONS DEB_BUILD_OPTIONS="nocheck no_lto" debpic
Run Command in container debpic "my command"
Install extra packages debpic --extra-pkg gdb
Set destination directory debpic --destination ~/my_built_packages
Pass args to dpkg-buildpackage debpic -- -b
Hook script (Configure) Write script to /etc/debpic/hooks/myscript
Hook script (Use) debpic --hook myscript
Use golang tooling debpic --hook gopath --interactive
Jenkins Integration See Using With Jenkins.
User Experience Info
Tab completion Yes
Man page Yes
Coloured Output Yes
Caching Container is cached. Ccache enabled by default.
Config file ~/.config/debpic/debpic.conf
Built package location ./built_packages/
Include extra tools Edit ./developer-packages.txt

Installation

  1. Download debpic debian package

  2. Install debpic

sudo apt install ~/Downloads/debpic_1.0.0_all.deb
  1. Configure docker to run as non-root user. See official docker documentation for more details.
sudo usermod -aG docker $USER
newgrp docker
  1. . Optionally - configure git to globally ignore generated built_packages directory
echo built_packages >> ~/.config/git/ignore

debpic's People

Contributors

aidan-gallagher avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

debpic's Issues

Improve support for --vscode

Experimental support for vscode was implemented.

It needs cleaned up and tested further.

  • Need to handle existing .devcontainer file.

Should consider devcontainer file to specify image name rather than dockerfile

  • This means vscode doesn't have to build from scratch despite debpic already having built it.
  • This gets around the problem that VSCode doesn't use BUILDKIT (removes /debian/changelog workaround)
  • This ensures vscode always opens latest version (no prompt from VSCode)
  • Don't need to populate build args.

Expand delete_images function

On top of deleting the debpic images this should

  • Stop all debpic containers (this will prevent the deleting of images from failing)
  • delete the docker volume

Don't update image if local repository changes

The dockerfile has

  • Remote apt repositories.
  • Local apt repositories

If the remote apt repositories change then the docker image doesn't have to be rebuilt (however it can be rebuilt with --no-cache).
If the local apt repository changes then the docker image must be rebuilt (because it uses COPY).

This is problematic because:

  • Some users have a workflow where they have --local-repository and --destination as the same directory to allow them to build multiple repositories that depend on each other. This is problematic because if you build repo1 successfully it deposits the .debs into it's local repository and invalidates it's cache.
  • The user may want to just run "apt update && apt upgrade" for faster updating rather than rebuilding the image.

The local repository stage must happen at build time before other dependencies are installed because a dependency in the control file might only exist in the local repository.

--no-cache should remove the ccache cache

Currently --no-cache is only used to remove the docker cache.

Given debpic also uses ccache by default --no-cache should remove the cache volume

Run the command: docker volume rm ccache_volume

Support user defined post_create_hook

Allow the user to run a hook in the container after setup.

The following instructions detail the steps necessary to run "go test ./..." for a debian package. It would be good if those steps could be automated after the container is set up.
https://github.com/aidan-gallagher/debpic/blob/main/debpic/Documentation/using-golang.md

The hook could either change the image or just the container.
I'm going to initially implement it as just the container because:

  • It's easier
  • The repository has to be mounted for the golang use case.

I expect a number of potentially useful hooks could be distributed by the debpic package. They would live under
/etc/debpic/hooks. The user could then select their hook via the command line arguments or debpic config file.

Consider using entrypoint
https://stackoverflow.com/questions/45371521/adding-startup-script-to-dockerfile

Support all DEB environment variables

Support all DEB_ and DH_ environment variables (not just DEB_BUILD_OPTIONS)

Consider making DEB_BUILD_OPTIONS an argument rather than environment variable.
* This stops host env variables accidentally being used in container build.
* Makes it possible to add these options to the config file.

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.