Skip to content

Commit 768cfc4

Browse files
authored
Add script to create a container manifest (#6735)
Add script to create a container manifest
1 parent ffa7e4b commit 768cfc4

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

docker/createManifest.ps1

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Used to create a container manifest.
2+
# Prereq: you must login to $ContainerRegistery before running this script
3+
# default scenarios is to build a `latest` tag which will point to the `ubuntu-16.04` tag for linux
4+
# and the `windowsservercore` tag for windows
5+
param(
6+
[parameter(Mandatory)]
7+
[string]
8+
$ContainerRegistry,
9+
10+
[ValidateNotNullOrEmpty()]
11+
[ValidatePattern('^[abcdefghijklmnopqrstuvwxyz-]+$')]
12+
[string]
13+
$ManifestTag = 'latest',
14+
15+
[ValidateNotNullOrEmpty()]
16+
[ValidatePattern('^[abcdefghijklmnopqrstuvwxyz-]+$')]
17+
[string]
18+
$Image = 'powershell',
19+
20+
[ValidateNotNullOrEmpty()]
21+
[ValidatePattern('^[abcdefghijklmnopqrstuvwxyz-]+$')]
22+
[string[]]
23+
$TagList = ('ubuntu-16.04', 'windowsservercore')
24+
)
25+
26+
$manifestList = @()
27+
foreach($tag in $TagList)
28+
{
29+
$manifestList += "$ContainerRegistry/${Image}:$tag"
30+
}
31+
32+
# Create the manifest
33+
docker manifest create $ContainerRegistry/${Image}:$ManifestTag $manifestList
34+
35+
# Inspect (print) the manifest
36+
docker manifest inspect $ContainerRegistry/${Image}:$ManifestTag
37+
38+
# push the manifest
39+
docker manifest push $ContainerRegistry/${Image}:$ManifestTag

0 commit comments

Comments
 (0)