9bb7fb8f69
I have checked the image can build things and inspected `diff -ru` compared to the old image. As far as I can tell it is more or less the same besides the later git change. Layers are now 65MB or less, and we aren't against the maxLayers limit for the broken automatic layering to do anything but shove one store path in a layer (which is good behaviour, actually). This uses nix2container which streams images, so the build time is much shorter. I have also taken the opportunity to, in addition to fixing the 400MB single layer (terrible, and what motivated this in the first place), delete about 200MB of closure size inflicted by git vs gitMinimal causing both perl and python to get into closure. People mostly use this thing for CI, so I don't really think you need advanced git operations, and large git can be added at the user side if really motivated. With love for whichever container developer somewhat ironically assumed that one would not run skopeo in a minimal container that doesn't have a /var/tmp. Fixes: https://git.lix.systems/lix-project/lix/issues/378 Change-Id: Icc3aa20e64446276716fbbb87535fd5b50628010
57 lines
1.5 KiB
Nix
57 lines
1.5 KiB
Nix
{ hydraJobs, pkgs }:
|
|
let
|
|
inherit (pkgs) lib;
|
|
lix = hydraJobs.build.x86_64-linux;
|
|
|
|
systems = [ "x86_64-linux" ];
|
|
dockerSystems = [ "x86_64-linux" ];
|
|
|
|
doTarball =
|
|
{
|
|
target,
|
|
targetName,
|
|
rename ? null,
|
|
}:
|
|
''
|
|
echo "doing: ${target}"
|
|
# expand wildcard
|
|
filename=$(echo ${target}/${targetName})
|
|
basename="$(basename $filename)"
|
|
|
|
echo $filename $basename
|
|
cp -v "$filename" "$out"
|
|
${lib.optionalString (rename != null) ''
|
|
mv "$out/$basename" "$out/${rename}"
|
|
basename="${rename}"
|
|
''}
|
|
sha256sum --binary $filename | cut -f1 -d' ' > $out/$basename.sha256
|
|
'';
|
|
|
|
targets =
|
|
builtins.map (system: {
|
|
target = hydraJobs.binaryTarball.${system};
|
|
targetName = "*.tar.xz";
|
|
}) systems
|
|
++ builtins.map (system: {
|
|
target = hydraJobs.dockerImage.${system}.tarball;
|
|
targetName = "image.tar.gz";
|
|
rename = "lix-${lix.version}-docker-image-${system}.tar.gz";
|
|
}) dockerSystems;
|
|
|
|
manualTar = pkgs.runCommand "lix-manual-tarball" { } ''
|
|
mkdir -p $out
|
|
cp -r ${lix.doc}/share/doc/nix/manual lix-${lix.version}-manual
|
|
tar -cvzf "$out/lix-${lix.version}-manual.tar.gz" lix-${lix.version}-manual
|
|
'';
|
|
|
|
tarballs = pkgs.runCommand "lix-release-tarballs" { } ''
|
|
mkdir -p $out
|
|
${lib.concatMapStringsSep "\n" doTarball targets}
|
|
cp ${manualTar}/*.tar.gz $out
|
|
cp -r ${lix.doc}/share/doc/nix/manual $out
|
|
'';
|
|
in
|
|
{
|
|
inherit (hydraJobs) build;
|
|
inherit tarballs;
|
|
}
|