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:
parent
8cbbfe7009
commit
2aefa0599e
4 changed files with 72 additions and 59 deletions
|
@ -5,28 +5,32 @@
|
|||
{ 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 {
|
||||
name = drv.name;
|
||||
let
|
||||
image = dockerTools.buildLayeredImage {
|
||||
name = drv.name;
|
||||
|
||||
contents = [
|
||||
# add a /bin/sh on all images
|
||||
busybox
|
||||
# most program need TLS certs
|
||||
cacert
|
||||
drv
|
||||
];
|
||||
|
||||
config = {
|
||||
Cmd = [ "/bin/${binName}" ];
|
||||
Env = [
|
||||
"PATH=/bin"
|
||||
"SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt"
|
||||
contents = [
|
||||
# add a /bin/sh on all images
|
||||
busybox
|
||||
# most program need TLS certs
|
||||
cacert
|
||||
drv
|
||||
];
|
||||
Labels = {
|
||||
# https://github.com/microscaling/microscaling/blob/55a2d7b91ce7513e07f8b1fd91bbed8df59aed5a/Dockerfile#L22-L33
|
||||
"org.label-schema.vcs-ref" = "master";
|
||||
"org.label-schema.vcs-url" = "https://github.com/nix-community/docker-nixpkgs";
|
||||
|
||||
config = {
|
||||
Cmd = [ "/bin/${binName}" ];
|
||||
Env = [
|
||||
"PATH=/bin"
|
||||
"SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt"
|
||||
];
|
||||
Labels = {
|
||||
# https://github.com/microscaling/microscaling/blob/55a2d7b91ce7513e07f8b1fd91bbed8df59aed5a/Dockerfile#L22-L33
|
||||
"org.label-schema.vcs-ref" = "master";
|
||||
"org.label-schema.vcs-url" = "https://github.com/nix-community/docker-nixpkgs";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
in
|
||||
image // { meta = meta // image.meta; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue