config 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # vim: filetype=yaml sw=2
  2. filename: 'container-image_[% c("var/container/suite") %]-[% c("var/container/arch") %]-[% c("version") %].tar.gz'
  3. version: 1
  4. pkg_type: build
  5. var:
  6. ubuntu_version: 20.04.1
  7. container:
  8. use_container: 1
  9. pre: |
  10. #!/bin/sh
  11. set -e
  12. rootdir=$(pwd)
  13. export DEBIAN_FRONTEND=noninteractive
  14. apt-get update -y -q
  15. apt-get install -y -q debian-archive-keyring ubuntu-keyring mmdebstrap gnupg patch
  16. export SOURCE_DATE_EPOCH='[% c("timestamp") %]'
  17. tar -xf [% c('input_files_by_name/mmdebstrap') %]
  18. # As a user namespace inside an other user namespace doesn't seem to work,
  19. # we patch mmdebstrap to avoid creating a new user namespace
  20. patch -d mmdebstrap -p1 < mmdebstrap-no-user-ns.patch
  21. ./mmdebstrap/mmdebstrap --mode=unshare [% c("var/container/mmdebstrap_opt") %] [% c("var/container/suite") %] output.tar.gz [% c("var/container/debian_mirror") %]
  22. [% IF c("var/minimal_apt_version") -%]
  23. mkdir base-image
  24. tar -C base-image -xf output.tar.gz ./var/lib/dpkg
  25. apt_version=$(dpkg --admindir=$rootdir/base-image/var/lib/dpkg -s apt | grep '^Version: ' | cut -d ' ' -f 2)
  26. echo "apt version: $apt_version"
  27. dpkg --compare-versions "$apt_version" ge '[% c("var/minimal_apt_version") %]'
  28. [% END -%]
  29. mv output.tar.gz [% dest_dir %]/[% c("filename") %]
  30. targets:
  31. jessie-amd64:
  32. var:
  33. minimal_apt_version: 1.0.9.8.6
  34. container:
  35. suite: jessie
  36. arch: amd64
  37. buster-amd64:
  38. var:
  39. minimal_apt_version: 1.8.2
  40. container:
  41. suite: buster
  42. arch: amd64
  43. input_files:
  44. - project: mmdebstrap
  45. name: mmdebstrap
  46. - URL: 'https://cdimage.ubuntu.com/ubuntu-base/releases/[% c("var/ubuntu_version") %]/release/ubuntu-base-[% c("var/ubuntu_version") %]-base-amd64.tar.gz'
  47. filename: 'container-image_ubuntu-base-[% c("var/ubuntu_version") %]-base-amd64.tar.gz'
  48. sha256sum: 97f6cbcf41f39272c84e32b6f926ed5d6906c6e463a557025181f4aa191ad667
  49. - filename: mmdebstrap-no-user-ns.patch