From ad41d1e39b10c56d819ef77c4f5eae6c31537fab Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Mon, 24 May 2021 12:28:17 +0200 Subject: [PATCH] Use streamLayeredImage for base image --- src/nix/modules/composition/arion-base-image.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/nix/modules/composition/arion-base-image.nix b/src/nix/modules/composition/arion-base-image.nix index 890c60b..b471313 100644 --- a/src/nix/modules/composition/arion-base-image.nix +++ b/src/nix/modules/composition/arion-base-image.nix @@ -6,11 +6,9 @@ { config, lib, pkgs, ... }: let - - tag = lib.head (lib.strings.splitString "-" (baseNameOf builtImage.outPath)); name = "arion-base"; - builtImage = pkgs.dockerTools.buildImage { + imageExe = pkgs.dockerTools.streamLayeredImage { inherit name; contents = pkgs.runCommand "minimal-contents" {} '' mkdir -p $out/bin $out/usr/bin @@ -19,6 +17,7 @@ let ''; config = {}; }; + inherit (imageExe) imageTag; in @@ -33,9 +32,9 @@ in }; config = { - arionBaseImage = "${name}:${tag}"; + arionBaseImage = "${name}:${imageTag}"; build.imagesToLoad = lib.mkIf (lib.any (s: s.service.useHostStore) (lib.attrValues config.services)) [ - { image = builtImage; imageName = name; imageTag = tag; } + { imageExe = imageExe; imageName = name; inherit imageTag; } ]; }; } \ No newline at end of file