Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions docker/createManifest.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Used to create a container manifest.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to leave a comment here that says that before running this script one needs to login to $ContainerRegistry using 'docker login ...' command.

# Prereq: you must login to $ContainerRegistery before running this script
# default scenarios is to build a `latest` tag which will point to the `ubuntu-16.04` tag for linux
# and the `windowsservercore` tag for windows
param(
[parameter(Mandatory)]
[string]
$ContainerRegistry,

[ValidateNotNullOrEmpty()]
[ValidatePattern('^[abcdefghijklmnopqrstuvwxyz-]+$')]
[string]
$ManifestTag = 'latest',

[ValidateNotNullOrEmpty()]
[ValidatePattern('^[abcdefghijklmnopqrstuvwxyz-]+$')]
[string]
$Image = 'powershell',

[ValidateNotNullOrEmpty()]
[ValidatePattern('^[abcdefghijklmnopqrstuvwxyz-]+$')]
[string[]]
$TagList = ('ubuntu-16.04', 'windowsservercore')
)

$manifestList = @()
foreach($tag in $TagList)
{
$manifestList += "$ContainerRegistry/${Image}:$tag"
}

# Create the manifest
docker manifest create $ContainerRegistry/${Image}:$ManifestTag $manifestList

# Inspect (print) the manifest
docker manifest inspect $ContainerRegistry/${Image}:$ManifestTag

# push the manifest
docker manifest push $ContainerRegistry/${Image}:$ManifestTag