image.name: Default to localhost/$name

This commit is contained in:
Robert Hensing 2022-04-23 23:09:54 +02:00
parent 40fd74e71f
commit 0ee76740d0
4 changed files with 7 additions and 6 deletions

View File

@ -233,7 +233,7 @@ Type:: string
Default::
+
----
{"_type":"literalExpression","text":"config.service.name"}
{"_type":"literalExpression","text":"\"localhost/\" + config.service.name"}
----

View File

@ -25,7 +25,8 @@ loadImages requestedImages = do
isNew i =
-- On docker, the image name is unmodified
(imageName i <> ":" <> imageTag i) `notElem` loaded
-- -- On podman, you automatically get a localhost prefix
-- On podman, you used to automatically get a localhost prefix
-- however, since NixOS 22.05, this expected to be part of the name instead
&& ("localhost/" <> imageName i <> ":" <> imageTag i) `notElem` loaded
traverse_ loadImage . filter isNew $ requestedImages

View File

@ -9,7 +9,7 @@
"PATH": "/usr/bin:/run/current-system/sw/bin/",
"container": "docker"
},
"image": "webserver:<HASH>",
"image": "localhost/webserver:<HASH>",
"ports": [
"8000:80"
],
@ -32,7 +32,7 @@
"images": [
{
"imageExe": "<STOREPATH>",
"imageName": "webserver",
"imageName": "localhost/webserver",
"imageTag": "<HASH>"
}
],

View File

@ -104,8 +104,8 @@ in
};
image.name = mkOption {
type = str;
default = config.service.name;
defaultText = lib.literalExpression or lib.literalExample "config.service.name";
default = "localhost/" + config.service.name;
defaultText = lib.literalExpression or lib.literalExample ''"localhost/" + config.service.name'';
description = ''
A human readable name for the docker image.