Commit Graph

17 Commits

Author SHA1 Message Date
James Westby 44030c910b Make the image build reproducible
Change the mkimage script so that the produced image is
reproducible. This involves:

   - removing the ldconfig aux-cache as it changes on every build.
   - set the mtimes of the files to a specific date so that the
     resulting tar file will have the same contents.
   - The `strings` guard around the unsafe-io tweak seems to be
     non-deterministic. It was sometimes not adding the tweak
     for the same file. Remove it as we don't care about older
     than jessie.
   - Importing the image by constructing a docker image with
     a specific timestamp and doing `docker load`.

Also change the buildall script to build each image twice and
confirm that the same tarball is produced, and that results
in the layers in the imported images matching.

Add a dockerdiff script that checks that two images are equivalent,
and tries to show the differences if not. This is useful when the
build script reports differences, as it can point to what the
differences are.
2017-02-10 11:48:28 +00:00
James Westby daeaab7326 Fix the loop to be POSIX-compatible. (#10)
We were using a bashism in install_packages, but it was
a `/bin/sh` script. This meant there was a syntax error, but
it didn't kill the script so it would loop forever.

Add a test for the install_packages loop by installing something
that doesn't exist. This will trigger the loop, and should hit
the maximum loop count and error out. If it doesn't then the timeout
command will kill it and the test will fail. Using a timeout
isn't ideal, but better than looping forever.

Also clean up the test script a little bit and print a description
of each test before running it.
2016-12-07 09:42:50 +00:00
James Westby 590b58eb70 Fix the typo in install_packages. (#9) 2016-12-01 17:21:14 +00:00
James Westby a09917a0ce Retry apt if it fails in install_packages. (#8)
Sometimes apt will fail due a transient network issue. Often that
will be fixed by retrying.

This is particularly useful as part of an automated build pipeline.
2016-11-30 15:11:33 +00:00
Adnan Abdulhussein dbc4db9441 install_packages: use --no-install-recommends flag by default (#7) 2016-11-25 10:24:19 +00:00
James Westby 47e1cb91ef Add some more commonly expected packages.
sysv-rc and util-linux are used in the postinst scripts
of some packages, and so those packages won't install
if they aren't available.

sysv-rc contains update-rc.d, so any package that installs
a service would fail to install. Those packages are common
to install in to containers.

util-linux contains the getopt command which some scripts
expect to find.
2016-10-19 12:22:47 +01:00
James Westby 875e3592f7 Don't delete copyright files.
Some licences require that the binaries be shipped with a copy
of the license. Debian does this in the copyright files in
/usr/share/doc. We need to leave those files there to keep
the image distributable.
2016-10-14 17:00:53 +01:00
James Westby 82ca442105 Don't use --force-yes. 2016-09-08 12:38:14 +01:00
James Westby 13da6c814e Set the correct dist in the sources.list file. 2016-09-08 12:24:29 +01:00
James Westby 370747c60f Set the sources.list and update from security. 2016-09-08 12:13:51 +01:00
James Westby 2e2ab24571 Run the second stage with bash. 2016-09-08 11:00:08 +01:00
James Westby e3cff8ae42 Improve the install_packages script. 2016-09-08 10:27:21 +01:00
James Westby af15d6de65 Build with set -x to get debug output. 2016-09-08 10:24:41 +01:00
James Westby f5120b8874 Remove --force-check-gpg as it is not supported on trusty. 2016-09-08 10:16:25 +01:00
James Westby 549a2eb616 Use custom debootstrap scripts.
These allow for us to further customize the packages installed.
2016-09-02 17:32:07 +01:00
James Westby a21737a453 Record a manifest of the packages installed.
Also log the image creation to a file.
2016-09-02 17:31:14 +01:00
James Westby 2916ff94f4 First go at minideb. 2016-09-02 14:48:09 +01:00