@@ -1012,7 +1012,7 @@ public void EndToEndMultiArch_RemoteRegistry()
1012
1012
. And . HaveStdOutContaining ( $ "Pushed image '{ imageX64 } ' to registry '{ registry } '.")
1013
1013
. And . HaveStdOutContaining ( $ "Pushed image '{ imageArm64 } ' to registry '{ registry } '.")
1014
1014
. And . HaveStdOutContaining ( $ "Pushed image index '{ imageIndex } ' to registry '{ registry } '.") ;
1015
-
1015
+
1016
1016
// Check that the containers can be run
1017
1017
// First pull the image from the registry for each platform
1018
1018
ContainerCli . PullCommand (
@@ -1029,7 +1029,7 @@ public void EndToEndMultiArch_RemoteRegistry()
1029
1029
imageFromRegistry )
1030
1030
. Execute ( )
1031
1031
. Should ( ) . Pass ( ) ;
1032
-
1032
+
1033
1033
// Run the containers
1034
1034
ContainerCli . RunCommand (
1035
1035
_testOutput ,
@@ -1351,4 +1351,45 @@ static string[] DecideEntrypoint(string rid, string appName, string workingDir)
1351
1351
return new [ ] { $ "{ workingDir } /{ binary } " } ;
1352
1352
}
1353
1353
}
1354
+
1355
+ [ DockerAvailableFact ( checkContainerdStoreAvailability : true ) ]
1356
+ public void EnforcesOciSchemaForMultiRIDTarballOutput ( )
1357
+ {
1358
+ string imageName = NewImageName ( ) ;
1359
+ string tag = "1.0" ;
1360
+
1361
+ // Create new console app
1362
+ DirectoryInfo newProjectDir = CreateNewProject ( "webapp" ) ;
1363
+
1364
+ // Run PublishContainer for multi-arch with ContainerGenerateLabels
1365
+ var publishResult = new DotnetCommand (
1366
+ _testOutput ,
1367
+ "publish" ,
1368
+ "/t:PublishContainer" ,
1369
+ "/p:RuntimeIdentifiers=\" linux-x64;linux-arm64\" " ,
1370
+ $ "/p:ContainerBaseImage={ DockerRegistryManager . FullyQualifiedBaseImageAspNet } ",
1371
+ $ "/p:ContainerRepository={ imageName } ",
1372
+ $ "/p:ContainerImageTag={ tag } ",
1373
+ "/p:EnableSdkContainerSupport=true" ,
1374
+ "/p:ContainerArchiveOutputPath=archive.tar.gz" ,
1375
+ "-getProperty:GeneratedImageIndex" ,
1376
+ "-getItem:GeneratedContainers" ,
1377
+ "/bl" )
1378
+ . WithWorkingDirectory ( newProjectDir . FullName )
1379
+ . Execute ( ) ;
1380
+
1381
+ publishResult . Should ( ) . Pass ( ) ;
1382
+ var jsonDump = JsonDocument . Parse ( publishResult . StdOut ) ;
1383
+ var index = JsonDocument . Parse ( jsonDump . RootElement . GetProperty ( "Properties" ) . GetProperty ( "GeneratedImageIndex" ) . ToString ( ) ) ;
1384
+ var containers = jsonDump . RootElement . GetProperty ( "Items" ) . GetProperty ( "GeneratedContainers" ) . EnumerateArray ( ) . ToArray ( ) ;
1385
+
1386
+ index . RootElement . GetProperty ( "mediaType" ) . GetString ( ) . Should ( ) . Be ( "application/vnd.oci.image.index.v1+json" ) ;
1387
+ containers . Should ( ) . HaveCount ( 2 ) ;
1388
+ foreach ( var container in containers )
1389
+ {
1390
+ container . GetProperty ( "ManifestMediaType" ) . GetString ( ) . Should ( ) . Be ( "application/vnd.oci.image.manifest.v1+json" ) ;
1391
+ }
1392
+ // Cleanup
1393
+ newProjectDir . Delete ( true ) ;
1394
+ }
1354
1395
}
0 commit comments