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:
@@ -254,5 +254,21 @@ import ./make-test-python.nix ({ pkgs, ... }: {
|
||||
"docker run --rm ${examples.layeredStoreSymlink.imageName} bash -c 'test -L ${examples.layeredStoreSymlink.passthru.symlink}'",
|
||||
"docker rmi ${examples.layeredStoreSymlink.imageName}",
|
||||
)
|
||||
|
||||
with subtest("buildImage supports registry/ prefix in image name"):
|
||||
docker.succeed(
|
||||
"docker load --input='${examples.prefixedImage}'"
|
||||
)
|
||||
docker.succeed(
|
||||
"docker images --format '{{.Repository}}' | grep -F '${examples.prefixedImage.imageName}'"
|
||||
)
|
||||
|
||||
with subtest("buildLayeredImage supports registry/ prefix in image name"):
|
||||
docker.succeed(
|
||||
"docker load --input='${examples.prefixedLayeredImage}'"
|
||||
)
|
||||
docker.succeed(
|
||||
"docker images --format '{{.Repository}}' | grep -F '${examples.prefixedLayeredImage.imageName}'"
|
||||
)
|
||||
'';
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user