dockerTools.buildLayeredImage: image names with registry/ prefix
When using `buildLayeredImage`, it is not possible to specify an image name of the form `<registry>/my/image`, although it is a valid name. This is due to derivations under `buildLayeredImage` using that image name as their derivation name, but slashes are not permitted in that context. A while ago, #13099 fixed that exact same problem in `buildImage` by using `baseNameOf name` in derivation names instead of `name`. This change does the same thing for `buildLayeredImage`.
This commit is contained in:
@@ -427,4 +427,18 @@ rec {
|
||||
tag = "latest";
|
||||
contents = [ pkgs.bash symlink ];
|
||||
} // { passthru = { inherit symlink; }; };
|
||||
|
||||
# image with registry/ prefix
|
||||
prefixedImage = pkgs.dockerTools.buildImage {
|
||||
name = "registry-1.docker.io/image";
|
||||
tag = "latest";
|
||||
config.Cmd = [ "${pkgs.hello}/bin/hello" ];
|
||||
};
|
||||
|
||||
# layered image with registry/ prefix
|
||||
prefixedLayeredImage = pkgs.dockerTools.buildLayeredImage {
|
||||
name = "registry-1.docker.io/layered-image";
|
||||
tag = "latest";
|
||||
config.Cmd = [ "${pkgs.hello}/bin/hello" ];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user