diskimage-builder/elements/dpkg
Gregory Haynes 45df304d48 Perform package install outside of debootstrap
Debootstrap only supports one apt repository to install packages from.
As a result, we do not consider the updates repo during debootstrap
causing us install a second kernel when we do an apt-get dist-upgrade
during build.

Lets use debootstrap to get us a minimal chroot, then add our repos and
install the correct packages from the start.

We also have to reorder the dpkg root.d scripts which configure apt so
they run before we perform our package installs.

Change-Id: I6a592db6f0a01d3b19d8e0786e63f1315a1ef647
Closes-Bug: #1637516
2016-11-30 15:16:46 +11:00
..
bin Add force-confdef in debian package install 2016-02-16 14:10:19 +01:00
cleanup.d Standarise tracing for scripts 2015-02-12 10:41:32 +11:00
extra-data.d Add a best-effort sudo safety check 2016-05-09 15:41:38 +10:00
finalise.d Allow disabling apt-get clean 2015-03-06 17:07:29 +00:00
pre-install.d Add install-bin element 2016-05-13 11:52:23 +10:00
root.d Perform package install outside of debootstrap 2016-11-30 15:16:46 +11:00
element-deps Add install-bin element 2016-05-13 11:52:23 +10:00
README.rst Update dpkg elements README from free text to table formatting 2015-08-31 13:43:04 -07:00

====
dpkg
====
Provide dpkg specific image building glue.

The ubuntu element needs customisations at the start and end of the image build
process that do not apply to RPM distributions, such as using the host machine
HTTP proxy when installing packages. These customisations live here, where they
can be used by any dpkg based element.

The dpkg specific version of install-packages is also kept here.

Environment Variables
---------------------

DIB_APT_KEYS
  :Required: No
  :Default: None
  :Description: If an extra or updated apt key is needed then define
    ``DIB_ADD_APT_KEYS`` with the path to a folder. Any key files inside will be
    added to the key ring before any apt-get commands take place.
  :Example: ``DIB_APT_KEYS=/etc/apt/trusted.gpg.d``

DIB_APT_LOCAL_CACHE
  :Required: No
  :Default: 1
  :Description: By default the ``$DIB_IMAGE_CACHE/apt/$DISTRO_NAME`` directory is
    mounted in ``/var/cache/apt/archives`` to cache the .deb files downloaded
    during the image creation. Use this variable if you wish to disable the
    internal cache of the ``/var/cache/apt/archives`` directory
  :Example: ``DIB_APT_LOCAL_CACHE=0`` will disable internal caching.

DIB_DISABLE_APT_CLEANUP
  :Required: No
  :Default: 0
  :Description: At the end of a dib run we clean the apt cache to keep the image
    size as small as possible. Use this variable to prevent cleaning the apt cache
    at the end of a dib run.
  :Example: ``DIB_DISABLE_APT_CLEANUP=1`` will disable cleanup.