mirror of
https://code.tvl.fyi/depot.git:/tools/nixery.git
synced 2025-03-15 06:01:51 +00:00
refactor(build-image): Remove implicit import of entire package set
Explicitly refer to where things come from, and also don't import dockerTools as it is no longer used for anything.
This commit is contained in:
parent
cf4d688636
commit
66c4d83b07
|
@ -39,14 +39,11 @@
|
|||
...
|
||||
}:
|
||||
|
||||
# Since this is essentially a re-wrapping of some of the functionality that is
|
||||
# implemented in the dockerTools, we need all of its components in our top-level
|
||||
# namespace.
|
||||
with builtins;
|
||||
with pkgs;
|
||||
with dockerTools;
|
||||
|
||||
let
|
||||
inherit (pkgs) lib runCommand writeText;
|
||||
|
||||
tarLayer = "application/vnd.docker.image.rootfs.diff.tar";
|
||||
baseName = baseNameOf name;
|
||||
|
||||
|
@ -150,7 +147,7 @@ let
|
|||
groupedLayers));
|
||||
|
||||
# Create a symlink forest into all top-level store paths.
|
||||
contentsEnv = symlinkJoin {
|
||||
contentsEnv = pkgs.symlinkJoin {
|
||||
name = "bulk-layers";
|
||||
paths = allContents.contents;
|
||||
};
|
||||
|
@ -172,7 +169,7 @@ let
|
|||
# This computes both an MD5 and a SHA256 hash of each layer, which are used
|
||||
# for different purposes. See the registry server implementation for details.
|
||||
allLayersJson = runCommand "fs-layer-list.json" {
|
||||
buildInputs = [ coreutils findutils jq openssl ];
|
||||
buildInputs = with pkgs; [ coreutils jq openssl ];
|
||||
} ''
|
||||
cat ${bulkLayers} | sort -t/ -k5 -n > layer-list
|
||||
echo ${customisationLayer} >> layer-list
|
||||
|
@ -204,7 +201,7 @@ let
|
|||
};
|
||||
configJson = writeText "${baseName}-config.json" (toJSON config);
|
||||
configMetadata = fromJSON (readFile (runCommand "config-meta" {
|
||||
buildInputs = [ jq openssl ];
|
||||
buildInputs = with pkgs; [ jq openssl ];
|
||||
} ''
|
||||
size=$(wc -c ${configJson} | cut -d ' ' -f1)
|
||||
sha256=$(sha256sum ${configJson} | cut -d ' ' -f1)
|
||||
|
|
Loading…
Reference in New Issue
Block a user