add meta attributes to all images

augment the images with meta attributes from the input packages.

and then use the meta.description as dockerhub metadata.
This commit is contained in:
zimbatm 2019-02-17 12:09:56 +01:00
parent 8cbbfe7009
commit 2aefa0599e
No known key found for this signature in database
GPG key ID: 71BAF6D40C1D63D7
4 changed files with 72 additions and 59 deletions

View file

@ -11,7 +11,11 @@ password=$2
org=${3:-nixpkgs}
user=$username:$password
releases_json=$(nix-instantiate ./release.nix --strict --eval --json)
nix_eval() {
nix-instantiate --strict --eval --json "$@"
}
releases_json=$(nix_eval release.nix)
to_json() {
local desc=$1 full_desc=$2
@ -25,7 +29,7 @@ echo "=== Updating Docker Hub project descriptions"
for attr in $(echo "$releases_json" | jq -r "keys[]") ; do
echo "--- $attr"
desc="$attr is automatically built from nix-community/docker-nixpkgs"
desc=$(nix_eval ./release.nix -A "$attr.meta.description" | jq -r .)
if [[ -f "$attr/README.md" ]]; then
full_desc=$(< "$attr/README.md")

View file

@ -5,8 +5,10 @@
{ drv # derivation to build the image for
# Name of the binary to run by default
, binName ? (builtins.parseDrvName drv.name).name
, meta ? drv.meta
}:
dockerTools.buildLayeredImage {
let
image = dockerTools.buildLayeredImage {
name = drv.name;
contents = [
@ -29,4 +31,6 @@ dockerTools.buildLayeredImage {
"org.label-schema.vcs-url" = "https://github.com/nix-community/docker-nixpkgs";
};
};
}
};
in
image // { meta = meta // image.meta; }

View file

@ -10,7 +10,8 @@
, nix
, xz
}:
dockerTools.buildImageWithNixDb {
let
image = dockerTools.buildImageWithNixDb {
inherit (nix) name;
contents = [
@ -50,4 +51,6 @@ dockerTools.buildImageWithNixDb {
"SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt"
];
};
}
};
in
image // { meta = nix.meta // image.meta; }

View file

@ -18,7 +18,9 @@ _: pkgs: {
kubectl = pkgs.callPackage ./kubectl {};
kubernetes-helm = pkgs.callPackage ./kubernetes-helm {};
nix = pkgs.callPackage ./nix {};
nix-unstable = nix.overrideAttrs (self: { nix = pkgs.nixUnstable; });
nix-unstable = nix.override {
nix = pkgs.nixUnstable;
};
};
}